[issue30485] Element.findall(path, dict) doesn't insert null namespace

2019-05-02 Thread Stefan Behnel
Change by Stefan Behnel : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___ ___

[issue30485] Element.findall(path, dict) doesn't insert null namespace

2019-04-18 Thread Stefan Behnel
Stefan Behnel added the comment: New changeset e8113f51a8bdf33188ee30a1c038a298329e7bfa by Stefan Behnel in branch 'master': bpo-30485: Change the prefix for defining the default namespace in ElementPath from None to '' since there is existing code that uses that and it's more convenient to

[issue30485] Element.findall(path, dict) doesn't insert null namespace

2019-04-16 Thread Stefan Behnel
Stefan Behnel added the comment: I submitted a PR that changes the API back to an empty string. While lxml uses None here, an all-strings mapping is simply more convenient. I will start supporting both in lxml from the next release. Comments welcome. --

[issue30485] Element.findall(path, dict) doesn't insert null namespace

2019-04-16 Thread Stefan Behnel
Change by Stefan Behnel : -- pull_requests: +12784 stage: needs patch -> patch review ___ Python tracker ___ ___ Python-bugs-list ma

[issue30485] Element.findall(path, dict) doesn't insert null namespace

2019-04-14 Thread Steve Dower
Steve Dower added the comment: I don't recall where I got the empty string from, but it's certainly what I've used there for a while. Maybe it's required in register_namespace() to set the default namespace? -- ___ Python tracker

[issue30485] Element.findall(path, dict) doesn't insert null namespace

2019-04-14 Thread Stefan Behnel
Stefan Behnel added the comment: New changeset 3c5a858ec6a4e5851903762770fe526a46d3c351 by Stefan Behnel in branch 'master': bpo-30485: Re-allow empty strings in ElementPath namespace mappings since they might actually be harmless and unused (and thus went undetected previously). (#12830) h

[issue30485] Element.findall(path, dict) doesn't insert null namespace

2019-04-14 Thread Stefan Behnel
Stefan Behnel added the comment: The script seems to generally assume that "" is a good representation for "no prefix", i.e. the default namespace, although that is IMHO more correctly represented as None. It's not very likely that this is the only script out there that makes that assumption.

[issue30485] Element.findall(path, dict) doesn't insert null namespace

2019-04-14 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: The relevant line is at https://github.com/python/cpython/blob/cd466559c4a312b3c1223a774ad4df19fc4f0407/PC/layout/support/appxmanifest.py#L407 . I guess it's something related to build artifacts for Windows and Steve can have a better answer over t

[issue30485] Element.findall(path, dict) doesn't insert null namespace

2019-04-14 Thread Stefan Behnel
Stefan Behnel added the comment: Interesting. Thanks for investigating this. It looks like the script "appxmanifest.py" uses an empty string as prefix for a lookup: File "D:\a\1\s\PC\layout\support\appxmanifest.py", line 407, in get_appxmanifest node = xml.find("m:Identity", NS) I don

[issue30485] Element.findall(path, dict) doesn't insert null namespace

2019-04-14 Thread Stefan Behnel
Change by Stefan Behnel : -- pull_requests: +12755 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://ma

[issue30485] Element.findall(path, dict) doesn't insert null namespace

2019-04-14 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: I am not sure but this commit seems to have broken Azure CI on master for Windows. The build checks were green when the PR while merging. I can see the ValueError added in e9927e1820caea01e576141d9a623ea394d43dad raised in the below CI log and it's

[issue30485] Element.findall(path, dict) doesn't insert null namespace

2019-04-14 Thread Stefan Behnel
Stefan Behnel added the comment: I've merged the PR. It matches the implementation that has been released in lxml almost two years ago. -- resolution: -> fixed stage: -> resolved status: open -> closed versions: +Python 3.8 -Python 3.7 ___ Python

[issue30485] Element.findall(path, dict) doesn't insert null namespace

2019-04-14 Thread Stefan Behnel
Stefan Behnel added the comment: New changeset e9927e1820caea01e576141d9a623ea394d43dad by Stefan Behnel in branch 'master': bpo-30485: support a default prefix mapping in ElementPath by passing None as prefix (#1823) https://github.com/python/cpython/commit/e9927e1820caea01e576141d9a623ea39

[issue30485] Element.findall(path, dict) doesn't insert null namespace

2017-05-26 Thread Roundup Robot
Changes by Roundup Robot : -- pull_requests: +1910 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail

[issue30485] Element.findall(path, dict) doesn't insert null namespace

2017-05-26 Thread Stefan Behnel
Stefan Behnel added the comment: Patch replaced by pull request. https://github.com/python/cpython/pull/1823 -- ___ Python tracker ___ ___

[issue30485] Element.findall(path, dict) doesn't insert null namespace

2017-05-26 Thread Stefan Behnel
Changes by Stefan Behnel : Removed file: http://bugs.python.org/file46906/lxml_elpath_empty_prefix.patch ___ Python tracker ___ ___ Python-bug

[issue30485] Element.findall(path, dict) doesn't insert null namespace

2017-05-26 Thread Stefan Behnel
Stefan Behnel added the comment: Agreed that this should be added. I think the key should be None, though, not the empty string. I attached a quick patch for lxml's corresponding file. It's mostly the same for ET. -- keywords: +patch Added file: http://bugs.python.org/file46906/lxml_el

[issue30485] Element.findall(path, dict) doesn't insert null namespace

2017-05-26 Thread Raymond Hettinger
Raymond Hettinger added the comment: I agree that this is a recurring irritant. -- nosy: +eli.bendersky, rhettinger, scoder type: behavior -> enhancement versions: +Python 3.7 -Python 3.6 ___ Python tracker ___

[issue30485] Element.findall(path, dict) doesn't insert null namespace

2017-05-26 Thread Ben Wainwright
New submission from Ben Wainwright: The findall method for ElementTree.Element handles namespace prefixes by tokenising the path and inserting the full namespace in braces based on entries in a dictionary. Unfortunately, this does not work for a namespace without a prefix, so if you have file