You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Code objects with non-equal co_linetables compare equal #95150
3.11only security fixes3.12only security fixesinterpreter-core(Objects, Python, Grammar, and Parser dirs)release-blockertriagedThe issue has been accepted as valid by a triager.type-bugAn unexpected behavior, bug, or error
changed the title [-]wrong error position in traceback when using generator expressions[/-][+]Code objects with non-equal `co_linetable`s compare equal[/+]on Jul 23, 2022
@markshannon: we should add co_linetable to the code equality (and maybe hash?) functions.
Probably co_exceptiontable too, since I’m pretty sure it’s possible to have two code objects that differ only in exception table when compiling custom ASTs. We definitely don't want those to dedup.
3.11only security fixes3.12only security fixesinterpreter-core(Objects, Python, Grammar, and Parser dirs)release-blockertriagedThe issue has been accepted as valid by a triager.type-bugAn unexpected behavior, bug, or error
Activity
wip: added _collections.py which leads to this bug python/cpython#95150…
alexmojaki commentedon Jul 22, 2022
Simpler reproduction:
brandtbucher commentedon Jul 22, 2022
Ooh, nice find! The code objects are being "deduplicated" in the compiler, even though they have different column positions.
We need to consider the entire positions table when comparing code objects for equality.
[-]wrong error position in traceback when using generator expressions[/-][+]Code objects with non-equal `co_linetable`s compare equal[/+]brandtbucher commentedon Jul 26, 2022
@markshannon: we should add
co_linetableto the code equality (and maybe hash?) functions.Probably
co_exceptiontabletoo, since I’m pretty sure it’s possible to have two code objects that differ only in exception table when compiling custom ASTs. We definitely don't want those to dedup.GH-95150: Use position and exception tables for code hashing and equa…
pythonGH-95150: Use position and exception tables for code hashing an…
GH-95150: Use position and exception tables for code hashing and equa…
pypi-executing: Autospec creation for update from version 1.0.0 to ve…
wip: added _collections.py which leads to this bug python/cpython#95150…
wip: added _collections.py which leads to this bug python/cpython#95150…