[issue20928] xml.etree.ElementInclude does not include nested xincludes

ruffsl report at bugs.python.org
Thu Feb 22 21:10:53 EST 2018


ruffsl <roxfoxpox at gmail.com> added the comment:

> Included file paths should be collected only along an inclusion path and not across independent subtrees.

Yes, well put.

> Maybe we should add a "max_depth" parameter to limit the maximum recursion depth, defaulting to e.g. 5, that users would have to pass in order to say "I know what I'm doing".

Could that be set to false by the user, just in case we don't know beforehand how deep the rabbit hole goes, but we're feeling overly committed to see it through?

Not to detract from the ticket, but I'd just like to share to a question related to this topic about the expected behavior of Xinclude [1]. You could also see it as a use case example for the recursive import feature we are currently deciding, of which would help avoid one more non system library to workaround [2].

[1] https://stackoverflow.com/q/48857647/2577586
[2] https://github.com/ComArmor/comarmor/blob/856dd339b090c28e86206d4d6af0fac050618e74/comarmor/__init__.py#L116

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue20928>
_______________________________________


More information about the Python-bugs-list mailing list