Skip to content
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

bpo-20443: make code objects filename an absolute path #13527

Closed
wants to merge 8 commits into from

Conversation

isidentical
Copy link
Sponsor Member

@isidentical isidentical commented May 23, 2019

make code objects filename an absolute path

https://bugs.python.org/issue20443

@benjaminp
Copy link
Contributor

The compiler isn't an appropriate place to do this. compiler("some", "exec", "<some file>") should return a code object with co_filename == "<some file>".

@isidentical
Copy link
Sponsor Member Author

Then, where to it'll return absolute path? For not breaking backwards compability, we can set up a future flag if it is OK?

@terryjreedy
Copy link
Member

Then, where to it'll return absolute path?

I think you meant, where to patch to that co_filename == ? I agree with what Benjamin implied, that the call site should pass in the absolute patch when there is one. The passed-in 'filename' can be anything and does not have to correspond to a real file on external storage.

For not breaking backwards compability, we can set up a future flag if it is OK?

This would definitely require a PEP.

@isidentical
Copy link
Sponsor Member Author

isidentical commented May 25, 2019

This would definitely require a PEP.

I know, i posted to python-ideas.

@vstinner
Copy link
Member

I concur with Benjamin: code object constructor is the wrong place to fix the issue. The filename must be made absolute somewhere in the caller. I'm not against https://bugs.python.org/issue20443 I'm only against the proposed implementation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants