This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Update importlib.util.module_for_loader/set_loader to set when __loader__ = None
Type: behavior Stage: test needed
Components: Library (Lib) Versions: Python 3.4
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: brett.cannon Nosy List: brett.cannon, eric.snow, gkcn, python-dev
Priority: normal Keywords: easy, patch

Created on 2013-02-03 16:49 by brett.cannon, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
python-issue-17117.diff gkcn, 2013-02-23 16:25 Patch that changes the way __loader__ attribute is checked review
Messages (9)
msg181281 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2013-02-03 16:49
The various importlib.util decorators involved with __loader__ should reset the attribute when it is set to None, just like for __package__.
msg181357 - (view) Author: Eric Snow (eric.snow) * (Python committer) Date: 2013-02-04 17:51
+1
msg182755 - (view) Author: Gökcen Eraslan (gkcn) * Date: 2013-02-23 16:25
The patch is attached. Is it correct?
msg182884 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2013-02-24 19:20
Yep, the patch looks right, Gökcen! If you want to update the tests and docs that would be great, but obviously don't feel obliged to.
msg182886 - (view) Author: Gökcen Eraslan (gkcn) * Date: 2013-02-24 19:27
Of course. I have also commented on issue#17116 but I couldn't find the pyexpat test you mentioned. I would like to fix #17116 and #17115
msg182888 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2013-02-24 19:32
Issue #17116 will be fixed by issue #17715 if you decide to tackle it. That bug will require C-level changes to the module type; just FYI.

Please consider a PSF contributor form, Gökcen, if you plan to continue to submit code (your importlib.util fixes are simple enough to not require anything yet, but tests added to that plus anything you do for issue #17115 will require the form in order for me to commit your code). Instructions can be found at http://www.python.org/psf/contrib/ .

And obviously thanks for taking a look at all of this!
msg182889 - (view) Author: Gökcen Eraslan (gkcn) * Date: 2013-02-24 19:36
I have already given my form to akheron during a Python sprint, I think he will submit it to PSF within a few days.
msg184094 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2013-03-13 17:45
New changeset 7647aae9481c by Brett Cannon in branch 'default':
Issue #17117: Have both import itself and importlib.util.set_loader()
http://hg.python.org/cpython/rev/7647aae9481c
msg184099 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2013-03-13 18:12
Thanks for the patch, Gökcen! Added you the Misc/ACKS.
History
Date User Action Args
2022-04-11 14:57:41adminsetgithub: 61319
2013-03-13 18:12:09brett.cannonsetstatus: open -> closed
resolution: fixed
messages: + msg184099
2013-03-13 17:45:45python-devsetnosy: + python-dev
messages: + msg184094
2013-02-24 19:36:12gkcnsetmessages: + msg182889
2013-02-24 19:32:18brett.cannonsetmessages: + msg182888
2013-02-24 19:27:21gkcnsetmessages: + msg182886
2013-02-24 19:20:10brett.cannonsetmessages: + msg182884
2013-02-23 16:25:09gkcnsetfiles: + python-issue-17117.diff

nosy: + gkcn
messages: + msg182755

keywords: + patch
2013-02-04 17:51:28eric.snowsetnosy: + eric.snow
messages: + msg181357
2013-02-03 16:50:09brett.cannonsetkeywords: + easy
2013-02-03 16:49:43brett.cannonlinkissue17115 dependencies
2013-02-03 16:49:34brett.cannoncreate