[Python-checkins] [python/cpython] 93602e: [3.5] bpo-29537: Tolerate legacy invalid bytecode ...

GitHub noreply at github.com
Wed Mar 8 01:41:02 EST 2017

  Branch: refs/heads/3.5
  Home:   https://github.com/python/cpython
  Commit: 93602e3af70d3b9f98ae2da654b16b3382b68d50
  Author: Nick Coghlan <ncoghlan at gmail.com>
  Date:   2017-03-08 (Wed, 08 Mar 2017)

  Changed paths:
    M Lib/importlib/_bootstrap_external.py
    M Lib/importlib/util.py
    M Lib/pkgutil.py
    M Lib/pydoc.py
    M Lib/test/test_extcall.py
    M Lib/test/test_importlib/source/test_file_loader.py
    M Lib/test/test_unpack_ex.py
    M Misc/NEWS
    M Modules/zipimport.c
    M Python/ceval.c
    M Python/import.c
    M Python/importlib_external.h
    M Python/pythonrun.c

  Log Message:
  [3.5] bpo-29537: Tolerate legacy invalid bytecode (#169)

bpo-27286 fixed a problem where BUILD_MAP_UNPACK_WITH_CALL could
be emitted with an incorrect oparg value, causing the eval loop
to access the wrong stack entry when attempting to read the
function name.

The associated magic number change caused significant problems when
attempting to upgrade to 3.5.3 for anyone that relies on pre-cached
bytecode remaining valid across maintenance releases.

This patch restores the ability to import legacy bytecode generated
by 3.5.0, 3.5.1 or 3.5.2, and modifies the eval loop to
avoid any harmful consequences from the potentially malformed legacy

Original import patch by Petr Viktorin, eval loop patch by Serhiy Storchaka,
and tests and integration by Nick Coghlan.

More information about the Python-checkins mailing list