[issue21736] Add __file__ attribute to frozen modules

2021-10-28 Thread Eric Snow
Eric Snow added the comment: I've opened the following issues related to frozen stdlib modules: https://bugs.python.org/issue45652 https://bugs.python.org/issue45658 https://bugs.python.org/issue45659 Again, I'm leaving this issue open to deal with the broader question of frozen modules

[issue21736] Add __file__ attribute to frozen modules

2021-10-18 Thread Barry A. Warsaw
Barry A. Warsaw added the comment: Weird. PR 28655 is merged on GH, but still shows open on this bpo ticket. -- ___ Python tracker ___

[issue21736] Add __file__ attribute to frozen modules

2021-10-18 Thread Gregory P. Smith
Gregory P. Smith added the comment: That appears to have caused https://bugs.python.org/issue45506 -- nosy: +gregory.p.smith ___ Python tracker ___

[issue21736] Add __file__ attribute to frozen modules

2021-10-14 Thread Eric Snow
Eric Snow added the comment: I've merged the change to add __file__ for frozen stdlib modules (when possible) and to set __path__ appropriately. There are still a number of things to address though: * set co_filename (for tracebacks) * implement FrozenImporter.get_filename() * implement

[issue21736] Add __file__ attribute to frozen modules

2021-10-14 Thread Eric Snow
Eric Snow added the comment: New changeset 79cf20e48d0b5d69d9fac2a0204b5ac2c366066a by Eric Snow in branch 'main': bpo-21736: Set __file__ on frozen stdlib modules. (gh-28656) https://github.com/python/cpython/commit/79cf20e48d0b5d69d9fac2a0204b5ac2c366066a --

[issue21736] Add __file__ attribute to frozen modules

2021-09-30 Thread Eric Snow
Change by Eric Snow : -- pull_requests: +27022 pull_request: https://github.com/python/cpython/pull/28656 ___ Python tracker ___

[issue21736] Add __file__ attribute to frozen modules

2021-09-30 Thread Eric Snow
Change by Eric Snow : -- pull_requests: +27021 pull_request: https://github.com/python/cpython/pull/28655 ___ Python tracker ___

[issue21736] Add __file__ attribute to frozen modules

2021-09-15 Thread Guido van Rossum
Guido van Rossum added the comment: > Note that the filename information is already available in the > code object's co_filename attribute. Hm, in the latest (3.11) main that's not true -- co_filename is set to something like "". And that's about right, since the filename contained in the

[issue21736] Add __file__ attribute to frozen modules

2021-09-14 Thread Eric Snow
Change by Eric Snow : -- pull_requests: +26748 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28335 ___ Python tracker ___

[issue21736] Add __file__ attribute to frozen modules

2021-08-31 Thread Guido van Rossum
Change by Guido van Rossum : -- nosy: +gvanrossum ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue21736] Add __file__ attribute to frozen modules

2020-03-18 Thread Brett Cannon
Change by Brett Cannon : -- nosy: -brett.cannon ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue21736] Add __file__ attribute to frozen modules

2014-06-15 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: On 15.06.2014 01:53, Nick Coghlan wrote: Can we just drop __file__ and set the origin for frozen modules to something that includes the original file name? This wouldn't really help, because too much code out there uses the __file__ attribute and

[issue21736] Add __file__ attribute to frozen modules

2014-06-14 Thread Eric Snow
Eric Snow added the comment: __file__ is the filename from which the module *was* loaded (the inspect doc [1] should probably reflect that [2]). The import machinery only uses the module's __spec__ (origin, etc.). __file__ is set strictly as informational (and for backward-compatibility).

[issue21736] Add __file__ attribute to frozen modules

2014-06-14 Thread Nick Coghlan
Nick Coghlan added the comment: Can we just drop __file__ and set the origin for frozen modules to something that includes the original file name? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21736

[issue21736] Add __file__ attribute to frozen modules

2014-06-12 Thread Marc-Andre Lemburg
New submission from Marc-Andre Lemburg: The missing __file__ attribute on frozen modules causes lots of issues with the stdlib (see e.g. Issue21709 and the stdlib test suite) and other tools that expect this attribute to always be present. The attached patch for 3.4.1 adds this attribute to

[issue21736] Add __file__ attribute to frozen modules

2014-06-12 Thread Marc-Andre Lemburg
Changes by Marc-Andre Lemburg m...@egenix.com: -- keywords: +patch Added file: http://bugs.python.org/file35595/__file__-for-frozen-modules.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21736

[issue21736] Add __file__ attribute to frozen modules

2014-06-12 Thread Barry A. Warsaw
Changes by Barry A. Warsaw ba...@python.org: -- nosy: +barry ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21736 ___ ___ Python-bugs-list mailing

[issue21736] Add __file__ attribute to frozen modules

2014-06-12 Thread Barry A. Warsaw
Barry A. Warsaw added the comment: I'm -0 on this patch. I can understand that in some sense, frozen modules do semantically have an associated file, but OTOH, once they're frozen the connection to their file is broken. Also, I think anything that assumes __file__ exists is simply broken

[issue21736] Add __file__ attribute to frozen modules

2014-06-12 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: On 12.06.2014 18:35, Barry A. Warsaw wrote: I'm -0 on this patch. I can understand that in some sense, frozen modules do semantically have an associated file, but OTOH, once they're frozen the connection to their file is broken. Also, I think

[issue21736] Add __file__ attribute to frozen modules

2014-06-12 Thread Barry A. Warsaw
Barry A. Warsaw added the comment: PBP might be reasonably used to justify it for the frozen case. I just don't want to use that as a wedge to define __file__ in *all* cases, even when no reasonable file name exists. -- ___ Python tracker