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
Add get_filename method to zipimport #48762
Comments
I have attached a rough patch implementing the get_filename. I I could not find any detailed discussion of what get_filename is """
It sounds like maybe a new PEP is needed to document all the extensions I don't think a brand new PEP is needed, but an amendment to PEP-302 My implementation fixes one of the problems in bpo-4197: $ ./python.exe testmodule.zip
**********************************************************************
File "testmodule.zip/__main__.py", line ?, in __main__.c
Failed example:
'line 2'
Expected nothing
Got:
'line 2'
**********************************************************************
1 items had failures:
1 of 1 in __main__.c
***Test Failed*** 1 failures. Note that line number is still reported as '?', but there is no crash. |
The spec get_filename is pretty simple: Return whatever __file__ would be set to if load_module() was called for (runpy's problem is that it never actually loads the module in question, |
Fixed for 2.7 in r67750. Will be ported to 2.6, 3.0 and 3.1. |
Correction - added as _get_filename() in that revision. Documenting it and making it public (i.e. removing the underscore) is |
ZipImporter.get_filename() made public in: |
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:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: