{"record":{"id":"e0d7c6b09ed565ea","repo":"aosabook/500lines","slug":"unsupported-bytecode-type-s-e0d7c6","errorCode":null,"errorMessage":"unsupported bytecode type: %s","messagePattern":"unsupported bytecode type: (.+?)","errorType":"exception","errorClass":"VirtualMachineError","httpStatus":null,"severity":"error","filePath":"interpreter/code/byterun/simple_python_interpreter.py","lineNumber":136,"sourceCode":"        return byteName, arguments\n\n    def dispatch(self, byteName, arguments):\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            if byteName.startswith('UNARY_'):\n                self.unaryOperator(byteName[6:])\n            elif byteName.startswith('BINARY_'):\n                self.binaryOperator(byteName[7:])\n            else:\n                # main dispatch\n                bytecode_fn = getattr(self, 'byte_%s' % byteName, None)\n                if not bytecode_fn:            # pragma: no cover\n                    raise VirtualMachineError(\n                        \"unsupported bytecode type: %s\" % byteName\n                    )\n                why = bytecode_fn(*arguments)\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\n","sourceCodeStart":118,"sourceCodeEnd":154,"githubUrl":"https://github.com/aosabook/500lines/blob/fba689d101eb5600f5c8f4d7fd79912498e950e2/interpreter/code/byterun/simple_python_interpreter.py#L118-L154","documentation":"Error \"unsupported bytecode type: %s\" thrown in aosabook/500lines.","triggerScenarios":"Thrown at interpreter/code/byterun/simple_python_interpreter.py:136 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Add a byte_<NAME> method to the VirtualMachine class for the unsupported instruction.","For UNARY_/BINARY_ opcodes, register the operator in the operator maps so the generic dispatch handles it.","Only run code compiled with a Python version whose bytecode set this interpreter implements."],"exampleFix":"def byte_LOAD_CONST(self, const):\n    self.push(const)  # implement the missing bytecode handler","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"}