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: _elementtree: assertion error if stdlib copy module is overriden
Type: Stage: resolved
Components: Versions: Python 3.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: vstinner
Priority: normal Keywords:

Created on 2017-07-10 16:47 by vstinner, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 2647 merged vstinner, 2017-07-10 16:49
PR 2649 merged vstinner, 2017-07-10 20:30
PR 2650 merged vstinner, 2017-07-10 20:31
Messages (5)
msg298073 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2017-07-10 16:47
The _elementtree fails with an assertion error if the stdlib copy module is overriden by the user.

haypo@selma$ mkdir copy/
haypo@selma$ touch copy/__init__.py
haypo@selma$ ./python -c 'import _elementtree'
python: Objects/abstract.c:153: PyObject_GetItem: Assertion `(item != NULL) ^ (PyErr_Occurred() != NULL)' failed.
Aborted (core dumped)
msg298080 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2017-07-10 20:28
New changeset b136f11f3a51f9282ae992bac68f170ca5563b55 by Victor Stinner in branch 'master':
bpo-30892: Fix _elementtree module initialization (#2647)
https://github.com/python/cpython/commit/b136f11f3a51f9282ae992bac68f170ca5563b55
msg298085 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2017-07-10 21:12
New changeset 044e156426825acac8b6c6d1ce14d5b7bcb20bc9 by Victor Stinner in branch '3.6':
bpo-30892: Fix _elementtree module initialization (#2647) (#2649)
https://github.com/python/cpython/commit/044e156426825acac8b6c6d1ce14d5b7bcb20bc9
msg298086 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2017-07-10 21:13
New changeset 7f567e7472dd6c3d066eec1c204301df251484b5 by Victor Stinner in branch '3.5':
bpo-30892: Fix _elementtree module initialization (#2647) (#2650)
https://github.com/python/cpython/commit/7f567e7472dd6c3d066eec1c204301df251484b5
msg298970 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2017-07-24 13:53
Python 2.7 doesn't seem to be affected:

$ python2
Python 2.7.13+ (heads/2.7:598f26b, Jul 21 2017, 01:18:41) 
[GCC 6.3.1 20161221 (Red Hat 6.3.1-1)] on linux2
>>> import _elementtree
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "<string>", line 1, in <module>
ImportError: cannot import name copy
History
Date User Action Args
2022-04-11 14:58:48adminsetgithub: 75075
2017-07-24 13:53:42vstinnersetstatus: open -> closed
resolution: fixed
stage: resolved
2017-07-24 13:53:35vstinnersetmessages: + msg298970
2017-07-10 21:13:51vstinnersetmessages: + msg298086
2017-07-10 21:12:39vstinnersetmessages: + msg298085
2017-07-10 20:31:28vstinnersetpull_requests: + pull_request2716
2017-07-10 20:30:16vstinnersetpull_requests: + pull_request2715
2017-07-10 20:28:06vstinnersetmessages: + msg298080
2017-07-10 16:49:04vstinnersetpull_requests: + pull_request2713
2017-07-10 16:47:29vstinnercreate