[issue22622] ElementTree only writes declaration when passed encoding

2020-05-18 Thread Stefan Behnel
Stefan Behnel added the comment: Right, thanks. Closing since this works in Py3. -- resolution: -> out of date stage: needs patch -> resolved status: open -> closed ___ Python tracker

[issue22622] ElementTree only writes declaration when passed encoding

2020-05-17 Thread Zackery Spytz
Zackery Spytz added the comment: Python 2 is EOL, so I think this issue should be closed. -- nosy: +ZackerySpytz ___ Python tracker ___

[issue22622] ElementTree only writes declaration when passed encoding

2015-09-09 Thread Martin Panter
Martin Panter added the comment: As far as I can tell this was already working, even in 3.4.0a1 (the first pre-release of 3.4): >>> tree.write('/dev/stdout', xml_declaration=True) But it is not working in Python 2: >>> tree.write('/dev/stdout', xml_declaration=True) Looking at the

[issue22622] ElementTree only writes declaration when passed encoding

2014-10-13 Thread towb
New submission from towb: This generates an XML declaration: import xml.etree.ElementTree as ET root = ET.Element('rss', version='2.0') tree = ET.ElementTree(root) tree.write('test.xml', encoding='iso-8859-1', xml_declaration=True) However the declaration disappears if your

[issue22622] ElementTree only writes declaration when passed encoding

2014-10-13 Thread Stefan Behnel
Changes by Stefan Behnel sco...@users.sourceforge.net: -- nosy: +eli.bendersky, scoder ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22622 ___ ___