Skip to content

co_filename does not match __file__ for frozen stdlib modules #89815

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
ericsnowcurrently opened this issue Oct 28, 2021 · 1 comment
Open
Labels
3.11 only security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs) type-bug An unexpected behavior, bug, or error

Comments

@ericsnowcurrently
Copy link
Member

BPO 45652
Nosy @ericsnowcurrently, @FFY00

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = None
created_at = <Date 2021-10-28.17:45:27.885>
labels = ['interpreter-core', 'type-bug', '3.11']
title = 'co_filename does not match __file__ for frozen stdlib modules'
updated_at = <Date 2021-10-28.17:45:27.885>
user = 'https://github.com/ericsnowcurrently'

bugs.python.org fields:

activity = <Date 2021-10-28.17:45:27.885>
actor = 'eric.snow'
assignee = 'none'
closed = False
closed_date = None
closer = None
components = ['Interpreter Core']
creation = <Date 2021-10-28.17:45:27.885>
creator = 'eric.snow'
dependencies = []
files = []
hgrepos = []
issue_num = 45652
keywords = []
message_count = 1.0
messages = ['405209']
nosy_count = 2.0
nosy_names = ['eric.snow', 'FFY00']
pr_nums = []
priority = 'normal'
resolution = None
stage = 'needs patch'
status = 'open'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue45652'
versions = ['Python 3.11']

@ericsnowcurrently
Copy link
Member Author

Frozen modules currently have co_filename set to "<frozen NAME>". It would be good to have it match __file__ instead. This will require require also fixing any code objects in the module's co_consts (and so on). It may make sense to take care of the while unmarshaling, but could be done (less efficiently) after the fact.

@ericsnowcurrently ericsnowcurrently added 3.11 only security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs) type-bug An unexpected behavior, bug, or error labels Oct 28, 2021
@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
SnoopJ added a commit to SnoopJ/cpython that referenced this issue Jul 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.11 only security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs) type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

1 participant