msg277717 - (view) |
Author: Dmitry Shachnev (mitya57) * |
Date: 2016-09-29 19:44 |
The documentation says that getiterator() still accepts a tag argument, but it does not: >>> from xml.etree.ElementTree import Element >>> el = Element('foo') >>> el.getiterator('bar') Traceback (most recent call last): File "", line 1, in SystemError: ../Python/getargs.c:1508: bad argument to internal function >>> el.getiterator(tag='bar') Traceback (most recent call last): File "", line 1, in TypeError: iter() takes at most 1 argument (140172072006928 given) This is with Python 3.6.0 beta 1 on Debian GNU/Linux amd64. |
|
|
msg277719 - (view) |
Author: Ned Deily (ned.deily) *  |
Date: 2016-09-29 19:51 |
Even better: Python 3.6.0b1 (v3.6.0b1:5b0ca4ed5e2f, Sep 12 2016, 09:24:46) [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> from xml.etree.ElementTree import Element >>> el = Element('foo') >>> el.getiterator('bar') Segmentation fault: 11 |
|
|
msg277721 - (view) |
Author: STINNER Victor (vstinner) *  |
Date: 2016-09-29 19:59 |
The bug seems related to the new FASTCALL calling convention introduced in Python 3.6b1. For an unknown reason, the METH_FASTCALL defined in Modules/clinic/_elementtree.c on _elementtree_Element_iter() seems to be ignored or lost somewhere? |
|
|
msg277722 - (view) |
Author: STINNER Victor (vstinner) *  |
Date: 2016-09-29 20:05 |
Oh... Modules/_elementtree.c uses a function defined in Modules/clinic/_elementtree.c. It hardcodes flags, whereas flags changed. Maybe the alias should be created differently to avoid such issue in the future? Moreover, obviously, we lack unit tests on this getiterator() method. |
|
|
msg277723 - (view) |
Author: Roundup Robot (python-dev)  |
Date: 2016-09-29 20:14 |
New changeset 1e29dca5dc4c by Victor Stinner in branch '3.6': Fix xml.etree.ElementTree.Element.getiterator() https://hg.python.org/cpython/rev/1e29dca5dc4c |
|
|
msg277724 - (view) |
Author: STINNER Victor (vstinner) *  |
Date: 2016-09-29 20:16 |
I pushed the first obvious fix to unblock the 3.6 beta 2 release scheduled for next monday. |
|
|
msg277725 - (view) |
Author: Serhiy Storchaka (serhiy.storchaka) *  |
Date: 2016-09-29 20:29 |
Here is a test. |
|
|
msg279370 - (view) |
Author: Roundup Robot (python-dev)  |
Date: 2016-10-25 07:38 |
New changeset ca1b91829edf by Serhiy Storchaka in branch '3.5': Issue #28314: Added tests for xml.etree.ElementTree.Element.getiterator(). https://hg.python.org/cpython/rev/ca1b91829edf New changeset c14a2d2a3b19 by Serhiy Storchaka in branch '3.6': Issue #28314: Added tests for xml.etree.ElementTree.Element.getiterator(). https://hg.python.org/cpython/rev/c14a2d2a3b19 New changeset 17334c1d9245 by Serhiy Storchaka in branch 'default': Issue #28314: Added tests for xml.etree.ElementTree.Element.getiterator(). https://hg.python.org/cpython/rev/17334c1d9245 |
|
|