[issue18105] ElementTree writes invalid files when UTF-16 encoding is specified

2013-09-01 Thread Serhiy Storchaka

Changes by Serhiy Storchaka storch...@gmail.com:


--
nosy: +scoder

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18105
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18105] ElementTree writes invalid files when UTF-16 encoding is specified

2013-09-01 Thread Stefan Behnel

Stefan Behnel added the comment:

I can well imagine that the serialiser is broken for this in Py2.x, given that 
the API accepts byte strings and stores them as such. The fix might be as 
simple as decoding byte strings in the serialiser before writing them out. 
Involves a pretty high performance regression, though (and ET's serialiser is 
known to be rather slow anyway).

Not sure if the current behaviour should be changed in 2.x.

In any case, it's a duplicate of the other ticket, which was *not* fixed for 
2.7.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18105
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18105] ElementTree writes invalid files when UTF-16 encoding is specified

2013-09-01 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Due to the fact that such bug was not fixed even in 3.2 where it was more ease 
I doubt that it worth to fix in 2.7.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18105
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18105] ElementTree writes invalid files when UTF-16 encoding is specified

2013-09-01 Thread Eli Bendersky

Eli Bendersky added the comment:

What Serhiy said.

--
resolution:  - wont fix
stage:  - committed/rejected
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18105
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18105] ElementTree writes invalid files when UTF-16 encoding is specified

2013-05-31 Thread Adam Urban

New submission from Adam Urban:

import xml.etree.ElementTree as ET
tree = ET.parse(myinput.xml)
tree.write(myoutput.xml, encoding=utf-16)

...Output is a garbled mess, often a mix of UTF-8 and UTF-16 bytes... UTF-8 
output works fine, but when UTF-16, UTF-16LE, or UTF-16BE are specified the 
output is mangled.

--
components: Unicode, XML
messages: 190392
nosy: Adam.Urban, ezio.melotti
priority: normal
severity: normal
status: open
title: ElementTree writes invalid files when UTF-16 encoding is specified
type: behavior
versions: 3rd party, Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 
3.3, Python 3.4, Python 3.5

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18105
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18105] ElementTree writes invalid files when UTF-16 encoding is specified

2013-05-31 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

For 3.3+ it was fixed in issue1767933.

--
nosy: +eli.bendersky, serhiy.storchaka
versions:  -3rd party, Python 2.6, Python 3.1, Python 3.2, Python 3.3, Python 
3.4, Python 3.5

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18105
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com