Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-bytecode for openSUSE:Factory checked in at 2023-04-20 15:14:13 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-bytecode (Old) and /work/SRC/openSUSE:Factory/.python-bytecode.new.2023 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-bytecode" Thu Apr 20 15:14:13 2023 rev:6 rq:1080283 version:0.14.1 Changes: -------- --- /work/SRC/openSUSE:Factory/python-bytecode/python-bytecode.changes 2022-12-16 17:52:10.116188362 +0100 +++ /work/SRC/openSUSE:Factory/.python-bytecode.new.2023/python-bytecode.changes 2023-04-20 15:15:12.782162731 +0200 @@ -1,0 +2,7 @@ +Wed Apr 19 09:32:16 UTC 2023 - Dirk Müller <dmuel...@suse.com> + +- update to 0.14.1: + * allow to disassemble code containing ``EXTENDED_ARG`` + targeting a ``NOP`` PR #117 + +------------------------------------------------------------------- Old: ---- bytecode-0.14.0.tar.gz New: ---- bytecode-0.14.1.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-bytecode.spec ++++++ --- /var/tmp/diff_new_pack.vfvati/_old 2023-04-20 15:15:13.334166476 +0200 +++ /var/tmp/diff_new_pack.vfvati/_new 2023-04-20 15:15:13.342166531 +0200 @@ -1,7 +1,7 @@ # # spec file for package python-bytecode # -# Copyright (c) 2022 SUSE LLC +# Copyright (c) 2023 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,7 +17,7 @@ Name: python-bytecode -Version: 0.14.0 +Version: 0.14.1 Release: 0 Summary: Python module to generate and modify bytecode License: MIT @@ -25,8 +25,8 @@ URL: https://github.com/vstinner/bytecode Source: https://files.pythonhosted.org/packages/source/b/bytecode/bytecode-%{version}.tar.gz BuildRequires: %{python_module base >= 3.8} -BuildRequires: %{python_module setuptools} BuildRequires: %{python_module setuptools_scm} +BuildRequires: %{python_module setuptools} BuildRequires: %{python_module typing_extensions if %python-base < 3.10} BuildRequires: fdupes BuildRequires: python-rpm-macros ++++++ bytecode-0.14.0.tar.gz -> bytecode-0.14.1.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/bytecode-0.14.0/.github/workflows/cis.yml new/bytecode-0.14.1/.github/workflows/cis.yml --- old/bytecode-0.14.0/.github/workflows/cis.yml 2022-11-30 22:38:20.000000000 +0100 +++ new/bytecode-0.14.1/.github/workflows/cis.yml 2023-04-04 10:03:09.000000000 +0200 @@ -74,5 +74,6 @@ uses: codecov/codecov-action@v3 if: github.event_name != 'schedule' with: + token: ${{ secrets.CODECOV_TOKEN }} name: codecov-umbrella fail_ci_if_error: true diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/bytecode-0.14.0/.pre-commit-config.yaml new/bytecode-0.14.1/.pre-commit-config.yaml --- old/bytecode-0.14.0/.pre-commit-config.yaml 1970-01-01 01:00:00.000000000 +0100 +++ new/bytecode-0.14.1/.pre-commit-config.yaml 2023-04-04 10:03:09.000000000 +0200 @@ -0,0 +1,17 @@ +repos: + - repo: https://github.com/pre-commit/mirrors-isort + rev: v5.10.1 + hooks: + - id: isort + - repo: https://github.com/psf/black + rev: 22.10.0 + hooks: + - id: black + - repo: https://github.com/pycqa/flake8 + rev: 6.0.0 + hooks: + - id: flake8 + - repo: https://github.com/pre-commit/mirrors-mypy + rev: v0.991 + hooks: + - id: mypy diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/bytecode-0.14.0/PKG-INFO new/bytecode-0.14.1/PKG-INFO --- old/bytecode-0.14.0/PKG-INFO 2022-11-30 22:38:33.239078000 +0100 +++ new/bytecode-0.14.1/PKG-INFO 2023-04-04 10:03:23.934406500 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: bytecode -Version: 0.14.0 +Version: 0.14.1 Summary: Python module to generate and modify bytecode Author-email: Victor Stinner <victor.stin...@gmail.com> Maintainer-email: "Matthieu C. Dartiailh" <m.dartia...@gmail.com> @@ -43,6 +43,7 @@ Classifier: Topic :: Software Development :: Libraries :: Python Modules Requires-Python: >=3.8 Description-Content-Type: text/x-rst +License-File: COPYING ******** bytecode diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/bytecode-0.14.0/doc/changelog.rst new/bytecode-0.14.1/doc/changelog.rst --- old/bytecode-0.14.0/doc/changelog.rst 2022-11-30 22:38:20.000000000 +0100 +++ new/bytecode-0.14.1/doc/changelog.rst 2023-04-04 10:03:09.000000000 +0200 @@ -1,6 +1,14 @@ ChangeLog ========= +2023-04-04: Version 0.14.1 +-------------------------- + +Bugfixes: + +- allow to disassemble code containing ``EXTENDED_ARG`` targeting a ``NOP`` PR #117 + + 2022-11-30: Version 0.14.0 -------------------------- diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/bytecode-0.14.0/doc/conf.py new/bytecode-0.14.1/doc/conf.py --- old/bytecode-0.14.0/doc/conf.py 2022-11-30 22:38:20.000000000 +0100 +++ new/bytecode-0.14.1/doc/conf.py 2023-04-04 10:03:09.000000000 +0200 @@ -18,7 +18,7 @@ # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. -sys.path.insert(0, os.path.abspath('.')) +sys.path.insert(0, os.path.abspath('../src')) from bytecode import __version__ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/bytecode-0.14.0/src/bytecode/__init__.py new/bytecode-0.14.1/src/bytecode/__init__.py --- old/bytecode-0.14.0/src/bytecode/__init__.py 2022-11-30 22:38:20.000000000 +0100 +++ new/bytecode-0.14.1/src/bytecode/__init__.py 2023-04-04 10:03:09.000000000 +0200 @@ -52,7 +52,6 @@ *, lineno: bool = False, ) -> str: - try_begins: List[TryBegin] = [] def format_line(index, line): @@ -87,7 +86,6 @@ return text def format_try_begin(instr: TryBegin, labels: dict) -> str: - if isinstance(instr.target, Label): try: arg = "<%s>" % labels[instr.target] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/bytecode-0.14.0/src/bytecode/cfg.py new/bytecode-0.14.1/src/bytecode/cfg.py --- old/bytecode-0.14.0/src/bytecode/cfg.py 2022-11-30 22:38:20.000000000 +0100 +++ new/bytecode-0.14.1/src/bytecode/cfg.py 2023-04-04 10:03:09.000000000 +0200 @@ -278,7 +278,6 @@ # an extra object on the stack. for i, instr in enumerate(self.block): - # Ignore SetLineno if isinstance(instr, (SetLineno)): continue @@ -384,7 +383,6 @@ # Instruction is final (return, raise, ...) so any following instruction # in the block is dead code. if instr.is_final(): - # Check for TryEnd after the final instruction which is possible # TryEnd being only pseudo instructions. if te := self.block.get_trailing_try_end(i): @@ -781,7 +779,6 @@ try_begin_inserted_in_block = False last_instr: Optional[Instr] = None for index, instr in enumerate(bytecode): - # Reference to the current block if we create a new one in the following. old_block: BasicBlock | None = None @@ -829,7 +826,6 @@ try_begin_inserted_in_block = False if old_block is not None and last_instr is not None: - # The last instruction is final, if the current instruction is a # TryEnd insert it in the same block and move to the next instruction if last_instr.is_final() and isinstance(instr, TryEnd): @@ -842,7 +838,6 @@ # If we have an active TryBegin and last_instr is: elif active_try_begin is not None: - # - a jump whose target is beyond the TryEnd of the active # TryBegin: we remember TryEnd should be prepended to the # target block. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/bytecode-0.14.0/src/bytecode/concrete.py new/bytecode-0.14.1/src/bytecode/concrete.py --- old/bytecode-0.14.0/src/bytecode/concrete.py 2022-11-30 22:38:20.000000000 +0100 +++ new/bytecode-0.14.1/src/bytecode/concrete.py 2023-04-04 10:03:09.000000000 +0200 @@ -220,7 +220,6 @@ class ConcreteBytecode(_bytecode._BaseBytecodeList[Union[ConcreteInstr, SetLineno]]): - #: List of "constant" objects for the bytecode consts: List @@ -297,7 +296,6 @@ def from_code( code: types.CodeType, *, extended_arg: bool = False ) -> "ConcreteBytecode": - instructions: MutableSequence[Union[SetLineno, ConcreteInstr]] # For Python 3.11+ we use dis to extract the detailed location information at # reduced maintenance cost. @@ -470,7 +468,6 @@ # then use as many 254 offset with no line change to reduce the offset to # less than 254. if doff > 254: - linetable.append(struct.pack("Bb", 254, dlineno)) doff -= 254 @@ -692,7 +689,6 @@ # We track the last set lineno to be able to compute deltas for _, i_size, new_lineno, location in iter_in: - # Infer the line if location is None location = location or InstrLocation(new_lineno, None, None, None) @@ -743,7 +739,7 @@ continue if extended_arg is not None: - arg = (extended_arg << 8) + instr.arg + arg = UNSET if instr.name == "NOP" else (extended_arg << 8) + instr.arg extended_arg = None instr = ConcreteInstr( @@ -1066,7 +1062,6 @@ class _ConvertBytecodeToConcrete: - # XXX document attributes #: Default number of passes of compute_jumps() before giving up. Refer to @@ -1117,7 +1112,6 @@ free_instrs: List[int] = [] for instr in self.bytecode: - # Enforce proper use of CACHE opcode on Python 3.11+ by checking we get the # number we expect or directly generate the needed ones. if isinstance(instr, Instr) and instr.name == "CACHE": @@ -1315,7 +1309,6 @@ # Resolve labels for exception handling entries for tb, entry in self.exception_handling_blocks.items(): - # Set the offset for the start and end offset from the instruction # index stored when assembling the concrete instructions. entry.start_offset = instruction_offsets[entry.start_offset] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/bytecode-0.14.0/src/bytecode/flags.py new/bytecode-0.14.1/src/bytecode/flags.py --- old/bytecode-0.14.0/src/bytecode/flags.py 2022-11-30 22:38:20.000000000 +0100 +++ new/bytecode-0.14.1/src/bytecode/flags.py 2023-04-04 10:03:09.000000000 +0200 @@ -134,7 +134,6 @@ # If performing inference or forcing an async behavior, first inspect # the flags since this is the only way to identify iterable coroutines if is_async in (None, True): - if bytecode.flags & CompilerFlags.COROUTINE: if sure_generator: flags |= CompilerFlags.ASYNC_GENERATOR diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/bytecode-0.14.0/src/bytecode/instr.py new/bytecode-0.14.1/src/bytecode/instr.py --- old/bytecode-0.14.0/src/bytecode/instr.py 2022-11-30 22:38:20.000000000 +0100 +++ new/bytecode-0.14.1/src/bytecode/instr.py 2023-04-04 10:03:09.000000000 +0200 @@ -68,7 +68,6 @@ # This make type checking happy but means it won't catch attempt to manipulate an unset # statically. We would need guard on object attribute narrowed down through methods class _UNSET(int): - instance = None def __new__(cls): @@ -667,7 +666,6 @@ class Instr(BaseInstr[InstrArg]): - __slots__ = () def _cmp_key(self) -> Tuple[Optional[InstrLocation], str, Any]: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/bytecode-0.14.0/src/bytecode/version.py new/bytecode-0.14.1/src/bytecode/version.py --- old/bytecode-0.14.0/src/bytecode/version.py 2022-11-30 22:38:33.000000000 +0100 +++ new/bytecode-0.14.1/src/bytecode/version.py 2023-04-04 10:03:23.000000000 +0200 @@ -5,7 +5,7 @@ #: A namedtuple of the version info for the current release. _version_info = namedtuple("_version_info", "major minor micro status") -parts = "0.14.0".split(".", 3) +parts = "0.14.1".split(".", 3) version_info = _version_info( int(parts[0]), int(parts[1]), @@ -16,4 +16,4 @@ # Remove everything but the 'version_info' from this module. del namedtuple, _version_info, parts -__version__ = "0.14.0" +__version__ = "0.14.1" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/bytecode-0.14.0/src/bytecode.egg-info/PKG-INFO new/bytecode-0.14.1/src/bytecode.egg-info/PKG-INFO --- old/bytecode-0.14.0/src/bytecode.egg-info/PKG-INFO 2022-11-30 22:38:33.000000000 +0100 +++ new/bytecode-0.14.1/src/bytecode.egg-info/PKG-INFO 2023-04-04 10:03:23.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: bytecode -Version: 0.14.0 +Version: 0.14.1 Summary: Python module to generate and modify bytecode Author-email: Victor Stinner <victor.stin...@gmail.com> Maintainer-email: "Matthieu C. Dartiailh" <m.dartia...@gmail.com> @@ -43,6 +43,7 @@ Classifier: Topic :: Software Development :: Libraries :: Python Modules Requires-Python: >=3.8 Description-Content-Type: text/x-rst +License-File: COPYING ******** bytecode diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/bytecode-0.14.0/src/bytecode.egg-info/SOURCES.txt new/bytecode-0.14.1/src/bytecode.egg-info/SOURCES.txt --- old/bytecode-0.14.0/src/bytecode.egg-info/SOURCES.txt 2022-11-30 22:38:33.000000000 +0100 +++ new/bytecode-0.14.1/src/bytecode.egg-info/SOURCES.txt 2023-04-04 10:03:23.000000000 +0200 @@ -1,5 +1,6 @@ .coveragerc .gitignore +.pre-commit-config.yaml .readthedocs.yaml COPYING MANIFEST.in diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/bytecode-0.14.0/tests/cell_free_vars_cases.py new/bytecode-0.14.1/tests/cell_free_vars_cases.py --- old/bytecode-0.14.0/tests/cell_free_vars_cases.py 2022-11-30 22:38:20.000000000 +0100 +++ new/bytecode-0.14.1/tests/cell_free_vars_cases.py 2023-04-04 10:03:09.000000000 +0200 @@ -35,7 +35,6 @@ def class_loadderef(): - a = 1 class B(A): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/bytecode-0.14.0/tests/exception_handling_cases.py new/bytecode-0.14.1/tests/exception_handling_cases.py --- old/bytecode-0.14.0/tests/exception_handling_cases.py 2022-11-30 22:38:20.000000000 +0100 +++ new/bytecode-0.14.1/tests/exception_handling_cases.py 2023-04-04 10:03:09.000000000 +0200 @@ -150,7 +150,6 @@ a = list(range(10)) with contextlib.nullcontext() as selector: - while a.pop(): # timeout = self._remaining_time(endtime) if sys is not None and sys.hexversion < 0: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/bytecode-0.14.0/tests/test_concrete.py new/bytecode-0.14.1/tests/test_concrete.py --- old/bytecode-0.14.0/tests/test_concrete.py 2022-11-30 22:38:20.000000000 +0100 +++ new/bytecode-0.14.1/tests/test_concrete.py 2023-04-04 10:03:09.000000000 +0200 @@ -244,7 +244,6 @@ ConcreteBytecode([Label()]) def test_to_code_lnotab(self): - # We use an actual function for the simple case to # ensure we get lnotab right def f(): @@ -786,6 +785,55 @@ self.assertEqual(concrete.consts, consts) self.assertInstructionListEqual(list(concrete), expected) + # Ensure that concrete._remove_extended_args can handle extended_arg NOPs that get + # passed in from other to_code/from_code methods. + def test_extended_arg_nop(self): + constants = [None] * (0x000129 + 1) + constants[0x000129] = "Arbitrary String" + # EXTENDED_ARG 0x01, NOP 0xFF, EXTENDED_ARG 0x01, + # LOAD_CONST 0x29, RETURN_VALUE 0x00 + codestring = bytes([0x90, 0x01, 0x09, 0xFF, 0x90, 0x01, 0x64, 0x29, 0x53, 0x00]) + codetype_list = [ + 0, + 0, + 0, + 1, + 64, + codestring, + tuple(constants), + (), + (), + "<no file>", + "code", + 1, + b"", + (), + (), + ] + if sys.version_info >= (3, 8): + codetype_list.insert(1, 0) + if sys.version_info >= (3, 11): + codetype_list.insert(12, "code") + codetype_list.insert(14, bytes()) + codetype_args = tuple(codetype_list) + code = types.CodeType(*codetype_args) + # Check it can be encoded and decoded + codetype_output = Bytecode.from_code(code).to_code().co_consts + + code = ConcreteBytecode() + code.consts = constants + code.extend( + [ + ConcreteInstr("EXTENDED_ARG", 0x01), + ConcreteInstr("NOP"), + ConcreteInstr("EXTENDED_ARG", 0x01), + ConcreteInstr("LOAD_CONST", 0x29), + ConcreteInstr("RETURN_VALUE"), + ] + ) + concrete_output = ConcreteBytecode.to_code(code).co_consts + self.assertEqual(codetype_output, concrete_output) + # The next three tests ensure we can round trip ConcreteBytecode generated # with extended_args=True diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/bytecode-0.14.0/tests/test_flags.py new/bytecode-0.14.1/tests/test_flags.py --- old/bytecode-0.14.0/tests/test_flags.py 2022-11-30 22:38:20.000000000 +0100 +++ new/bytecode-0.14.1/tests/test_flags.py 2023-04-04 10:03:09.000000000 +0200 @@ -23,7 +23,6 @@ infer_flags(1) def test_flag_inference(self): - # Check no loss of non-infered flags code = ControlFlowGraph() code.flags |= ( @@ -138,7 +137,6 @@ # Test inference in the presence of pre-existing flags for is_async in (None, True): - # Infer generator code = ConcreteBytecode() code.append(ConcreteInstr("YIELD_VALUE")) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/bytecode-0.14.0/tests/test_instr.py new/bytecode-0.14.1/tests/test_instr.py --- old/bytecode-0.14.0/tests/test_instr.py 2022-11-30 22:38:20.000000000 +0100 +++ new/bytecode-0.14.1/tests/test_instr.py 2023-04-04 10:03:09.000000000 +0200 @@ -111,7 +111,6 @@ Instr("xxx") def test_repr(self): - # No arg r = repr(Instr("NOP", lineno=10)) self.assertIn("NOP", r) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/bytecode-0.14.0/tox.ini new/bytecode-0.14.1/tox.ini --- old/bytecode-0.14.0/tox.ini 2022-11-30 22:38:20.000000000 +0100 +++ new/bytecode-0.14.1/tox.ini 2023-04-04 10:03:09.000000000 +0200 @@ -39,10 +39,7 @@ -r doc/requirements.txt commands = pip install . - mkdir docs_output sphinx-build doc docs_output -W -b html -whitelist_externals = - mkdir [flake8] ignore = E203, E266, E501, W503, F403, F401