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: xml.parsers.expat.(errors|model) don't set the __loader__ attribute
Type: behavior Stage: resolved
Components: Versions: Python 3.4
process
Status: closed Resolution: fixed
Dependencies: 17115 Superseder:
Assigned To: brett.cannon Nosy List: brett.cannon, gkcn
Priority: normal Keywords: easy, patch

Created on 2013-02-03 16:47 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-17116.diff gkcn, 2013-02-23 17:15 simple patch that sets the __loader__s of errors and model modules of pyexpat to None review
Messages (4)
msg181280 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2013-02-03 16:47
A new test in test_importlib is discovering that pyexpat is creating both its errors and model modules by hand in pyexpat's initialization function. Should at least set __loader__ to None there.
msg182773 - (view) Author: Gökcen Eraslan (gkcn) * Date: 2013-02-23 17:15
Should this be done in Modules/pyexpat.c file or in Lib/xml/parsers/expat.py? If modifying expat.py is sufficient, then attached simple patch does the job. By the way I couldn't find the test you are referring to. Is it in Lib/test/test_importlib of somewhere else?
msg182887 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2013-02-24 19:27
The comment is out of date; I removed the test because it was constantly failing.

As for the patch, it looks correct, but I plan to make a change to Python so that __loader__ is set by default (see the dependent issue #17115). If I don't get to that change I will commit the patch, else it will implicitly get fixed.
msg188383 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2013-05-04 17:58
New changeset e39a8f8ceb9f by Brett Cannon in branch 'default':
#17115,17116: Have modules initialize the __package__ and __loader__
http://hg.python.org/cpython/rev/e39a8f8ceb9f
History
Date User Action Args
2022-04-11 14:57:41adminsetgithub: 61318
2013-05-04 17:58:17brett.cannonsetstatus: open -> closed
resolution: fixed
messages: + msg188383

stage: resolved
2013-04-28 02:52:52brett.cannonunlinkissue17115 dependencies
2013-02-24 19:27:49brett.cannonsetmessages: + msg182887
2013-02-23 17:15:23gkcnsetfiles: + python-issue-17116.diff

nosy: + gkcn
messages: + msg182773

keywords: + patch
2013-02-08 14:01:12brett.cannonsetdependencies: + __loader__ = None should be fine
2013-02-03 16:50:18brett.cannonsetkeywords: + easy
2013-02-03 16:47:46brett.cannonlinkissue17115 dependencies
2013-02-03 16:47:37brett.cannoncreate