Source: python-bytecode
Version: 0.13.0-2
Severity: serious
Tags: sid bookworm
User: debian...@lists.debian.org
Usertags: needs-update
User: debian-pyt...@lists.debian.org
Usertags: python3.11
Control: affects -1 src:python3-defaults

Dear maintainer(s),

We are in the transition of adding python3.11 as a supported Python version [0]. With a recent upload of python3-defaults the autopkgtest of python-bytecode fails in testing when that autopkgtest is run with the binary packages of python3-defaults from unstable. It passes when run with only packages from testing. In tabular form:

                       pass            fail
python3-defaults       from testing    3.10.6-3
python-bytecode        from testing    0.13.0-2
all others             from testing    from testing

I copied some of the output at the bottom of this report.

Currently this regression is blocking the migration of python3-defaults to testing [1]. https://docs.python.org/3/whatsnew/3.11.html lists what's new in Python3.11, it may help to identify what needs to be updated.

More information about this bug and the reason for filing it can be found on
https://wiki.debian.org/ContinuousIntegration/RegressionEmailInformation

Paul

[0] https://bugs.debian.org/1021984
[1] https://qa.debian.org/excuses.php?package=python3-defaults

https://ci.debian.net/data/autopkgtest/testing/amd64/p/python-bytecode/28728884/log.gz

=================================== FAILURES =================================== _________________________ BytecodeTests.test_empty_dup _________________________

self = <[AttributeError("'Instr' object has no attribute '_arg'") raised in repr()] Instr object at 0x7fcc47774e00>
name = 'DUP_TOP', arg = <object object at 0x7fcc485c0c70>, lineno = None

    def _set(self, name, arg, lineno):
        if not isinstance(name, str):
            raise TypeError("operation name must be a str")
        try:
          opcode = _opcode.opmap[name]
E           KeyError: 'DUP_TOP'

/usr/lib/python3/dist-packages/bytecode/instr.py:233: KeyError

During handling of the above exception, another exception occurred:

self = <tests.test_bytecode.BytecodeTests testMethod=test_empty_dup>

    def test_empty_dup(self):
        code = Bytecode()
        code.first_lineno = 1
      code.extend([Instr("DUP_TOP")])

tests/test_bytecode.py:426: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib/python3/dist-packages/bytecode/instr.py:171: in __init__
    self._set(name, arg, lineno)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <[AttributeError("'Instr' object has no attribute '_arg'") raised in repr()] Instr object at 0x7fcc47774e00>
name = 'DUP_TOP', arg = <object object at 0x7fcc485c0c70>, lineno = None

    def _set(self, name, arg, lineno):
        if not isinstance(name, str):
            raise TypeError("operation name must be a str")
        try:
            opcode = _opcode.opmap[name]
        except KeyError:
          raise ValueError("invalid operation name")
E           ValueError: invalid operation name

/usr/lib/python3/dist-packages/bytecode/instr.py:235: ValueError
_____________ BytecodeTests.test_for_iter_stack_effect_computation _____________

self = <[AttributeError("'Instr' object has no attribute '_arg'") raised in repr()] Instr object at 0x7fcc47774ea0> name = 'JUMP_ABSOLUTE', arg = <bytecode.instr.Label object at 0x7fcc4797afe0>
lineno = None

    def _set(self, name, arg, lineno):
        if not isinstance(name, str):
            raise TypeError("operation name must be a str")
        try:
          opcode = _opcode.opmap[name]
E           KeyError: 'JUMP_ABSOLUTE'

/usr/lib/python3/dist-packages/bytecode/instr.py:233: KeyError

During handling of the above exception, another exception occurred:

self = <tests.test_bytecode.BytecodeTests testMethod=test_for_iter_stack_effect_computation>

    def test_for_iter_stack_effect_computation(self):
        with self.subTest():
            code = Bytecode()
            code.first_lineno = 1
            lab1 = Label()
            lab2 = Label()
            code.extend(
                [
                    lab1,
                    Instr("FOR_ITER", lab2),
                    Instr("STORE_FAST", "i"),
                  Instr("JUMP_ABSOLUTE", lab1),
                    lab2,
                ]
            )

tests/test_bytecode.py:472: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib/python3/dist-packages/bytecode/instr.py:171: in __init__
    self._set(name, arg, lineno)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <[AttributeError("'Instr' object has no attribute '_arg'") raised in repr()] Instr object at 0x7fcc47774ea0> name = 'JUMP_ABSOLUTE', arg = <bytecode.instr.Label object at 0x7fcc4797afe0>
lineno = None

    def _set(self, name, arg, lineno):
        if not isinstance(name, str):
            raise TypeError("operation name must be a str")
        try:
            opcode = _opcode.opmap[name]
        except KeyError:
          raise ValueError("invalid operation name")
E           ValueError: invalid operation name

/usr/lib/python3/dist-packages/bytecode/instr.py:235: ValueError
_________________________ BytecodeTests.test_from_code _________________________

self = <tests.test_bytecode.BytecodeTests testMethod=test_from_code>

    def test_from_code(self):
        code = get_code(
            """
            if test:
                x = 1
            else:
                x = 2
        """
        )
      bytecode = Bytecode.from_code(code)

tests/test_bytecode.py:133: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib/python3/dist-packages/bytecode/bytecode.py:191: in from_code
    concrete = _bytecode.ConcreteBytecode.from_code(code)
/usr/lib/python3/dist-packages/bytecode/concrete.py:184: in from_code
    instr = ConcreteInstr.disassemble(lineno, code.co_code, offset)
/usr/lib/python3/dist-packages/bytecode/concrete.py:118: in disassemble
    return cls(name, arg, lineno=lineno, offset=index)
/usr/lib/python3/dist-packages/bytecode/concrete.py:51: in __init__
    self._set(name, arg, lineno)
/usr/lib/python3/dist-packages/bytecode/concrete.py:65: in _set
    super()._set(name, arg, lineno)
/usr/lib/python3/dist-packages/bytecode/instr.py:239: in _set
    _check_lineno(lineno)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
lineno = 0

    def _check_lineno(lineno):
        if not isinstance(lineno, int):
            raise TypeError("lineno must be an int")
        if lineno < 1:
          raise ValueError("invalid lineno")
E           ValueError: invalid lineno

/usr/lib/python3/dist-packages/bytecode/instr.py:74: ValueError
____________________ BytecodeTests.test_from_code_freevars _____________________

self = <tests.test_bytecode.BytecodeTests testMethod=test_from_code_freevars>

    def test_from_code_freevars(self):
        ns = {}
        exec(
            textwrap.dedent(
                """
            def create_func():
                x = 1
                def func():
                    return x
                return func
                func = create_func()
        """
            ),
            ns,
            ns,
        )
        code = ns["func"].__code__
            bytecode = Bytecode.from_code(code)
      self.assertEqual(
            bytecode,
            [
                Instr("LOAD_DEREF", FreeVar("x"), lineno=5),
                Instr("RETURN_VALUE", lineno=5),
            ],
        )
E AssertionError: [<COPY_FREE_VARS arg=1 lineno=4>, <RESUME a[76 chars]o=5>] != [<LOAD_DEREF arg=<FreeVar 'x'> lineno=5>, <[18 chars]o=5>]

tests/test_bytecode.py:192: AssertionError
____________________ BytecodeTests.test_from_code_load_fast ____________________

self = <tests.test_bytecode.BytecodeTests testMethod=test_from_code_load_fast>

    def test_from_code_load_fast(self):
        code = get_code(
            """
            def func():
                x = 33
                y = x
        """,
            function=True,
        )
        code = Bytecode.from_code(code)
      self.assertEqual(
            code,
            [
                Instr("LOAD_CONST", 33, lineno=2),
                Instr("STORE_FAST", "x", lineno=2),
                Instr("LOAD_FAST", "x", lineno=3),
                Instr("STORE_FAST", "y", lineno=3),
                Instr("LOAD_CONST", None, lineno=3),
                Instr("RETURN_VALUE", lineno=3),
            ],
        )
E AssertionError: [<RESUME arg=0 lineno=1>, <LOAD_CONST arg=3[156 chars]o=3>] != [<LOAD_CONST arg=33 lineno=2>, <STORE_FAST [131 chars]o=3>]

tests/test_bytecode.py:210: AssertionError
___________________ BytecodeTests.test_negative_size_binary ____________________

self = <[AttributeError("'Instr' object has no attribute '_arg'") raised in repr()] Instr object at 0x7fcc47055080> name = 'BINARY_POWER', arg = <object object at 0x7fcc485c0c70>, lineno = None

    def _set(self, name, arg, lineno):
        if not isinstance(name, str):
            raise TypeError("operation name must be a str")
        try:
          opcode = _opcode.opmap[name]
E           KeyError: 'BINARY_POWER'

/usr/lib/python3/dist-packages/bytecode/instr.py:233: KeyError

During handling of the above exception, another exception occurred:

self = <tests.test_bytecode.BytecodeTests testMethod=test_negative_size_binary>

    def test_negative_size_binary(self):
        opnames = (
            "BINARY_POWER",
            "BINARY_MULTIPLY",
            "BINARY_MATRIX_MULTIPLY",
            "BINARY_FLOOR_DIVIDE",
            "BINARY_TRUE_DIVIDE",
            "BINARY_MODULO",
            "BINARY_ADD",
            "BINARY_SUBTRACT",
            "BINARY_SUBSCR",
            "BINARY_LSHIFT",
            "BINARY_RSHIFT",
            "BINARY_AND",
            "BINARY_XOR",
            "BINARY_OR",
        )
        for opname in opnames:
            with self.subTest():
                code = Bytecode()
                code.first_lineno = 1
              code.extend([Instr("LOAD_CONST", 1), Instr(opname)])

tests/test_bytecode.py:327: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib/python3/dist-packages/bytecode/instr.py:171: in __init__
    self._set(name, arg, lineno)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <[AttributeError("'Instr' object has no attribute '_arg'") raised in repr()] Instr object at 0x7fcc47055080> name = 'BINARY_POWER', arg = <object object at 0x7fcc485c0c70>, lineno = None

    def _set(self, name, arg, lineno):
        if not isinstance(name, str):
            raise TypeError("operation name must be a str")
        try:
            opcode = _opcode.opmap[name]
        except KeyError:
          raise ValueError("invalid operation name")
E           ValueError: invalid operation name

/usr/lib/python3/dist-packages/bytecode/instr.py:235: ValueError
__ BytecodeTests.test_negative_size_binary_with_disable_check_of_pre_and_post __

self = <[AttributeError("'Instr' object has no attribute '_arg'") raised in repr()] Instr object at 0x7fcc470565c0> name = 'BINARY_POWER', arg = <object object at 0x7fcc485c0c70>, lineno = None

    def _set(self, name, arg, lineno):
        if not isinstance(name, str):
            raise TypeError("operation name must be a str")
        try:
          opcode = _opcode.opmap[name]
E           KeyError: 'BINARY_POWER'

/usr/lib/python3/dist-packages/bytecode/instr.py:233: KeyError

During handling of the above exception, another exception occurred:

self = <tests.test_bytecode.BytecodeTests testMethod=test_negative_size_binary_with_disable_check_of_pre_and_post>

    def test_negative_size_binary_with_disable_check_of_pre_and_post(self):
        opnames = (
            "BINARY_POWER",
            "BINARY_MULTIPLY",
            "BINARY_MATRIX_MULTIPLY",
            "BINARY_FLOOR_DIVIDE",
            "BINARY_TRUE_DIVIDE",
            "BINARY_MODULO",
            "BINARY_ADD",
            "BINARY_SUBTRACT",
            "BINARY_SUBSCR",
            "BINARY_LSHIFT",
            "BINARY_RSHIFT",
            "BINARY_AND",
            "BINARY_XOR",
            "BINARY_OR",
        )
        for opname in opnames:
            with self.subTest():
                code = Bytecode()
                code.first_lineno = 1
              code.extend([Instr("LOAD_CONST", 1), Instr(opname)])

Attachment: OpenPGP_signature
Description: OpenPGP digital signature

Reply via email to