Issue 3151: elementtree serialization bug for weird namespace urls (original) (raw)

Issue3151

Created on 2008-06-20 15:16 by xrotwang, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
etree.patch amaury.forgeotdarc,2008-06-20 20:48
Messages (4)
msg68463 - (view) Author: robert forkel (xrotwang) Date: 2008-06-20 15:16
when serializing elementtrees with weird namespaces like {$stuff}, the generated xml is not valid: Python 2.5.1 (r251:54863, Mar 7 2008, 04:10:12) [GCC 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)] on linux2 IDLE 1.2.1 ==== No Subprocess ==== >>> from xml.etree import ElementTree as et >>> e = et.fromstring('<prefix:localname xmlns:prefix="${stuff}"/>') >>> e.tag '{${stuff}}localname' >>> t = et.ElementTree(e) >>> from StringIO import StringIO >>> f = StringIO() >>> t.write(f) >>> f.seek(0) >>> print f.read() <ns0:}localname xmlns:ns0="${stuff" />
msg68475 - (view) Author: Amaury Forgeot d'Arc (amaury.forgeotdarc) * (Python committer) Date: 2008-06-20 20:48
A one-letter fix :-) (the localname cannot contain special characters)
msg99397 - (view) Author: Florent Xicluna (flox) * (Python committer) Date: 2010-02-16 11:58
Thanks for the one-letter fix. Test added to the upgrade proposed on #6472.
msg100862 - (view) Author: Florent Xicluna (flox) * (Python committer) Date: 2010-03-11 14:53
Fixed in trunk.
History
Date User Action Args
2022-04-11 14:56:35 admin set github: 47401
2010-03-11 14:53:28 flox set status: open -> closedsuperseder: Update ElementTree with upstream changesmessages: + dependencies: - Update ElementTree with upstream changesresolution: fixedstage: patch review -> resolved
2010-02-16 11:58:48 flox set versions: + Python 3.2nosy: + floxmessages: + dependencies: + Update ElementTree with upstream changes
2009-07-04 03:22:11 ezio.melotti set priority: normalstage: patch reviewversions: + Python 2.7, - Python 2.5
2008-06-20 23:36:07 akuchling set keywords: + easy
2008-06-20 20:48:04 amaury.forgeotdarc set files: + etree.patchassignee: effbotmessages: + keywords: + patchnosy: + amaury.forgeotdarc, effbot
2008-06-20 15:16:20 xrotwang create