| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
Considering the fact that we use input.systemId just after, I don't know if the options class is meant to indicate "hey, you can use systemId", I think we need an issue as well and a NEWS entry. |
Sorry, something went wrong.
|
I'll put together a more thorough analysis. |
Sorry, something went wrong.
|
Please see issue #128302 for a full write-up and analysis of what's going on here. |
Sorry, something went wrong.
There was a problem hiding this comment.
LGTM in general, but it would be nice to have tests.
You can also consider splitting this PR on two PRs, as it fixes two unrelated bugs.
Sorry, something went wrong.
|
I'll look at adding some tests. There's no existing tests for this module, but you have to start somewhere I suppose. Would it be better if this was two MRs? I'm happy to split it if so. |
Sorry, something went wrong.
|
Yes better to do it in another PR for the tests |
Sorry, something went wrong.
There was a problem hiding this comment.
I see now that it is difficult to add new tests, because there are no any tests for xmlbuilder at all. And adding meaningful tests is a larger issue, much larger than this bug fix. But we need any test, just to check that the new code works and the old code does not work. Even if they are only two test in a new file.
Sorry, something went wrong.
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
Here are some tests for the changed behavior. test.test_xml_dom_xmlbuilder.XMLBuilderTest.test_builder is basic and passes without these changes, but the other three all fail if run against main. I'm a little reluctant to split this MR in two now that I've added tests/test_xml_dom_xmlbuilder.py because it'd be a bit of a pain to manage the merge conflicts that would occur for that file. |
Sorry, something went wrong.
|
If it's too hard, let's do it in one PR if Serhiy agrees. I don't think there will be conflicts though but the file looks smalle enough. |
Sorry, something went wrong.
There was a problem hiding this comment.
LGTM! 👍
Sorry, something went wrong.
|
Thanks @tungol for the PR, and @serhiy-storchaka for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13. |
Sorry, something went wrong.
|
Thanks @tungol for the PR, and @serhiy-storchaka for merging it 🌮🎉.. I'm working now to backport this PR to: 3.12. |
Sorry, something went wrong.
* Allow DOMParser.parse() to correctly handle DOMInputSource instances that only have a systemId attribute set. * Fix DOMEntityResolver.resolveEntity(), which was broken by the Python 3.0 transition. * Add Lib/test/test_xml_dom_xmlbuilder.py with few tests. (cherry picked from commit 6ea04da) Co-authored-by: Stephen Morton <git@tungol.org>
* Allow DOMParser.parse() to correctly handle DOMInputSource instances that only have a systemId attribute set. * Fix DOMEntityResolver.resolveEntity(), which was broken by the Python 3.0 transition. * Add Lib/test/test_xml_dom_xmlbuilder.py with few tests. (cherry picked from commit 6ea04da) Co-authored-by: Stephen Morton <git@tungol.org>
|
GH-128582 is a backport of this pull request to the 3.13 branch. |
Sorry, something went wrong.
|
GH-128583 is a backport of this pull request to the 3.12 branch. |
Sorry, something went wrong.
* Allow DOMParser.parse() to correctly handle DOMInputSource instances that only have a systemId attribute set. * Fix DOMEntityResolver.resolveEntity(), which was broken by the Python 3.0 transition. * Add Lib/test/test_xml_dom_xmlbuilder.py with few tests.
gh-128302: Fix bugs in xml.dom.xmlbuilder (GH-128284) * Allow DOMParser.parse() to correctly handle DOMInputSource instances that only have a systemId attribute set. * Fix DOMEntityResolver.resolveEntity(), which was broken by the Python 3.0 transition. * Add Lib/test/test_xml_dom_xmlbuilder.py with few tests. (cherry picked from commit 6ea04da) Co-authored-by: Stephen Morton <git@tungol.org>
gh-128302: Fix bugs in xml.dom.xmlbuilder (GH-128284) * Allow DOMParser.parse() to correctly handle DOMInputSource instances that only have a systemId attribute set. * Fix DOMEntityResolver.resolveEntity(), which was broken by the Python 3.0 transition. * Add Lib/test/test_xml_dom_xmlbuilder.py with few tests. (cherry picked from commit 6ea04da) Co-authored-by: Stephen Morton <git@tungol.org>
⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️Hi! The buildbot PPC64LE Fedora Stable Refleaks 3.12 has failed when building commit 07a65cd. What do you need to do:
You can take a look at the buildbot page here: https://buildbot.python.org/#/builders/1210/builds/711 Failed tests:
Failed subtests:
Summary of the results of the build (if available): == Click to see traceback logsTraceback (most recent call last):
File "/home/buildbot/buildarea/3.12.cstratak-fedora-stable-ppc64le.refleak/build/Lib/test/test_glob.py", line 418, in test_selflink
self.assertIn(path, results)
AssertionError: 'dir/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/file' not found in {'dir/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/file', 'dir/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/file', 'dir/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/file', 'dir/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/file', 'dir/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/file', 'dir/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/file', 'dir/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/file', 'dir/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/file'}
Traceback (most recent call last):
File "/home/buildbot/buildarea/3.12.cstratak-fedora-stable-ppc64le.refleak/build/Lib/test/test_glob.py", line 418, in test_selflink
self.assertIn(path, results)
AssertionError: 'dir/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/file' not found in {'dir/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/file', 'dir/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/file', 'dir/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/file', 'dir/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/file'}
|
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
This looks like a bug. The Options class has no systemId attribute, but the input parameter, which seems to be an instance of DOMInputSource, does.
I don't really know how this is meant to be used, but given this code:
As-is this raises an error:
File "test.py", line 6, in <module> print(db.parse(source)) ~~~~~~~~^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/xml/dom/xmlbuilder.py", line 192, in parse if fp is None and options.systemId: ^^^^^^^^^^^^^^^^ AttributeError: 'Options' object has no attribute 'systemId'With this change:
I'd consider adding a test, but there's no tests right now for any of this.