1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2026-06-27 14:43:29 +00:00
community.general/plugins
patchback[bot] b4e3d32e5a
[PR #12148/5004c9f7 backport][stable-12] xml: preserve DOCTYPE declaration when writing XML files (#12248)
xml: preserve DOCTYPE declaration when writing XML files (#12148)

* fix(xml): preserve DOCTYPE declaration when writing XML files

Pass `doctype=tree.docinfo.doctype` to all `ElementTree.write()` calls
so lxml does not silently drop the DOCTYPE on serialization. Also replace
`etree.tostring()` with BytesIO+write() in the diff and xmlstring paths
for consistency.

Fixes #2762



* test(xml): add integration test for DOCTYPE preservation



* feat(changelog): add fragment for xml DOCTYPE fix (#12148)



---------


(cherry picked from commit 5004c9f70f)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-13 17:33:13 +02:00
..
action [PR #12078/e6ca0df5 backport][stable-12] Fix typing (#12079) 2026-05-19 08:25:30 +02:00
become [PR #11771/df252e5f backport][stable-12] incus, machinectl, run0 - fix become over pty connections (#11827) 2026-04-15 22:01:06 +02:00
cache [PR #11400/236b9c0e backport][stable-12] Sort imports with ruff check --fix (#11409) 2026-01-09 19:36:52 +01:00
callback [PR #12113/ef5b22d1 backport][stable-12] unixy callback: fix KeyError when task is delegated to host without ansible_host set (#12142) 2026-05-30 20:29:37 +02:00
connection [PR #12163/f9d4f0ad backport][stable-12] Fix incus Windows modules with ansible-core 2.21 (#12178) 2026-06-02 21:18:39 +02:00
doc_fragments [PR #11462/ce7cb4e9 backport][stable-12] New module icinga2_downtime (#11532) 2026-02-23 06:17:51 +01:00
filter [PR #12167/97b464de backport][stable-12] version_sort filter: fix example's description (#12170) 2026-06-02 21:18:20 +02:00
inventory [PR #11573/f9e583da backport][stable-12] fix: remove HTTPStatus constructs introduced in Python 3.11 (#11575) 2026-03-12 20:59:26 +01:00
lookup [PR #12140/48db8630 backport][stable-12] filetree lookup: handle invalid exclude regex with AnsibleError (#12183) 2026-06-04 06:28:35 +02:00
module_utils [PR #12124/b799c6f5 backport][stable-12] redfish_config: fix KeyError: 'ret' when SetManagerNic cannot find a matching NIC (#12173) 2026-06-02 21:18:06 +02:00
modules [PR #12148/5004c9f7 backport][stable-12] xml: preserve DOCTYPE declaration when writing XML files (#12248) 2026-06-13 17:33:13 +02:00
plugin_utils [PR #11567/9b72d954 backport][stable-12] Add missing __future__ imports (#11569) 2026-03-11 07:10:34 +01:00
test [PR #11400/236b9c0e backport][stable-12] Sort imports with ruff check --fix (#11409) 2026-01-09 19:36:52 +01:00