allow etree.XMLParser to resolve external entities#17504
Open
jancrichter wants to merge 3 commits intogalaxyproject:devfrom
Open
allow etree.XMLParser to resolve external entities#17504jancrichter wants to merge 3 commits intogalaxyproject:devfrom
jancrichter wants to merge 3 commits intogalaxyproject:devfrom
Conversation
1ee533f to
66bc0b5
Compare
mvdbeek
approved these changes
Jun 4, 2025
Member
mvdbeek
left a comment
There was a problem hiding this comment.
I've limited the location of external entities to the same directory of the file that is currently being loaded and added test cases for blocked and resolved entities. I think this is surely fine, certainly since this was possible in an unrestricted way before lxml 5.
e03473c to
51705f9
Compare
nsoranzo
reviewed
Jun 9, 2025
We use XML external (file) entities to include .rst files for the help section in tool XMLs. U ntil recently this wasn't a problem, but the default in lxml was recently changed and there is no way in planemo linting or testing to set this flag for the XMLParser. This change mainly makes parse_xml() use the old default.
Thanks Nicola! Co-authored-by: Nicola Soranzo <nicola.soranzo@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
We use XML external (file) entities to include .rst files for the help section in tool XMLs. U ntil recently this wasn't a problem, but the default in lxml was recently changed and there is no way in planemo linting or testing to set this flag for the XMLParser.
This change mainly makes
parse_xml()use the old default by settingresolve_entities=Trueforetree.XMLParserWithout this change planemo 75.20 on Galaxy 22.05 fails with the following error message. The same error message also appears when running planemo serve (at the very beginining) but does not make it fail. Tools load fine and work normally.
How to test the changes?
(Select all options that apply)
The tools use a doctype declaration and XML macro to include .rst files as help section:
xml/defaults.xml:
tool.xml:
Running planemo lint or test on this causes the above error.
License