classification
Title: Element.{get,iter} doesn't handle keyword arguments when using _elementtree C accelerator.
Type: behavior Stage: resolved
Components: Library (Lib), XML Versions: Python 3.3, Python 3.4
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: eli.bendersky Nosy List: eli.bendersky, franck
Priority: normal Keywords: patch

Created on 2013-01-03 12:36 by franck, last changed 2013-01-05 15:05 by eli.bendersky. This issue is now closed.

Files
File name Uploaded Description Edit
etree.patch franck, 2013-01-03 12:36 Full patch review
Messages (3)
msg178939 - (view) Author: Franck Michea (franck) * Date: 2013-01-03 12:36
Documentation:
 - http://docs.python.org/3.3/library/xml.etree.elementtree.html#xml.etree.ElementTree.Element.get
 - http://docs.python.org/3.3/library/xml.etree.elementtree.html#xml.etree.ElementTree.Element.iter

These two functions are documented with keyword arguments. Python implementation works correctly, but as of 3.3, _etreeelement module in C is hot-patching this module to enhance speed. C implementation only expects normal arguments for get and iter. This is what this patch fixes.

First patch so:
 - I am not sure about the "key" string in kwlist array, I followed code above and it doesn't work without it, so I guess it's to for the normal arg.
 - I am not sure about how to test iter with this. tag argument is never used.
 - Included a test that shows the problem.

Have a nice day,
msg178987 - (view) Author: Eli Bendersky (eli.bendersky) * (Python committer) Date: 2013-01-03 20:32
Thank you for the patch, Franck. I will review it when I have the time.
msg179123 - (view) Author: Eli Bendersky (eli.bendersky) * (Python committer) Date: 2013-01-05 14:34
The patch was committed with some minor modifications to 3.3 (c1fc6b6d1cfc) and default branch (e1bee8b09828).

New tests were added to the test classes (please don't add new tests to the doctests, they are deprecated).
History
Date User Action Args
2013-01-05 15:05:56eli.benderskysetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2013-01-05 14:34:46eli.benderskysetmessages: + msg179123
2013-01-03 20:32:01eli.benderskysetassignee: eli.bendersky
stage: patch review
messages: + msg178987
versions: + Python 3.4
2013-01-03 18:47:38ned.deilysetnosy: + eli.bendersky
2013-01-03 12:36:42franckcreate