{"record":{"id":"dd3226385b343751","repo":"aosabook/500lines","slug":"unsupported-bytecode-type-s","errorCode":null,"errorMessage":"unsupported bytecode type: %s","messagePattern":"unsupported bytecode type: (.+?)","errorType":"exception","errorClass":"VirtualMachineError","httpStatus":null,"severity":"error","filePath":"interpreter/code/byterun/pyvm2.py","lineNumber":211,"sourceCode":"\n        return byte_name, argument\n\n    def dispatch(self, byte_name, argument):\n        \"\"\" Dispatch by bytename to the corresponding methods.\n        Exceptions are caught and set on the virtual machine.\"\"\"\n\n        # When later unwinding the block stack,\n        # we need to keep track of why we are doing it.\n        why = None\n        try:\n            bytecode_fn = getattr(self, 'byte_%s' % byte_name, None)\n            if bytecode_fn is None:\n                if byte_name.startswith('UNARY_'):\n                    self.unaryOperator(byte_name[6:])\n                elif byte_name.startswith('BINARY_'):\n                    self.binaryOperator(byte_name[7:])\n                else:\n                    raise VirtualMachineError(\n                        \"unsupported bytecode type: %s\" % byte_name\n                    )\n            else:\n                why = bytecode_fn(*argument)\n        except:\n            # deal with exceptions encountered while executing the op.\n            self.last_exception = sys.exc_info()[:2] + (None,)\n            why = 'exception'\n\n        return why\n\n    def manage_block_stack(self, why):\n        block = self.frame.block_stack[-1]\n\n        if block.type == 'loop' and why == 'continue':\n            self.jump(self.return_value)\n            why = None\n            return why","sourceCodeStart":193,"sourceCodeEnd":229,"githubUrl":"https://github.com/aosabook/500lines/blob/fba689d101eb5600f5c8f4d7fd79912498e950e2/interpreter/code/byterun/pyvm2.py#L193-L229","documentation":"Error \"unsupported bytecode type: %s\" thrown in aosabook/500lines.","triggerScenarios":"Thrown at interpreter/code/byterun/pyvm2.py:211 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Implement a byte_<NAME> method on VirtualMachine for the missing bytecode.","If it is a unary or binary operator, add the operator to UNARY_OPERATORS/BINARY_OPERATORS so the dispatch handles it.","Confirm the Python version whose bytecode you are executing matches the version the VM supports."],"exampleFix":"def byte_PRINT_ITEM(self):\n    item = self.frame.pop()\n    print(item, end=' ')  # add the missing handler to VirtualMachine","handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"fba689d101eb5600f5c8f4d7fd79912498e950e2","analyzedAt":"2026-08-13T06:26:32.792Z","schemaVersion":2},"datasetVersion":"2026-08-13T09:17:06.757Z"}