[issue16986] ElementTree incorrectly parses strings with declared encoding not UTF-8

2013-05-22 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Here is an updated patch.

--
Added file: http://bugs.python.org/file30341/etree_parse_str_2.patch

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



[issue16986] ElementTree incorrectly parses strings with declared encoding not UTF-8

2013-05-22 Thread Eli Bendersky

Eli Bendersky added the comment:

LGTM

--

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



[issue16986] ElementTree incorrectly parses strings with declared encoding not UTF-8

2013-05-22 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 7781ccae7b9a by Serhiy Storchaka in branch '3.3':
Issue #16986: ElementTree now correctly parses a string input not only when
http://hg.python.org/cpython/rev/7781ccae7b9a

New changeset 659c1ce8ed2f by Serhiy Storchaka in branch 'default':
Issue #16986: ElementTree now correctly parses a string input not only when
http://hg.python.org/cpython/rev/659c1ce8ed2f

--
nosy: +python-dev

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



[issue16986] ElementTree incorrectly parses strings with declared encoding not UTF-8

2013-05-22 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Oh, 2.7 still uses old doctests. It's a challenge to backport tests for this 
issue.

--
versions:  -Python 3.2

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



[issue16986] ElementTree incorrectly parses strings with declared encoding not UTF-8

2013-05-22 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Due to the fact that ElementTree's documentation doesn't promise parsing 
Unicode string perhaps it shouldn't be backported to 2.7. At least I hadn't 
backported corresponded pyexpat changes (which affects pure Python ElementTree) 
to 2.7.

--
assignee:  - serhiy.storchaka
resolution:  - fixed
stage: needs patch - committed/rejected
status: open - closed
versions:  -Python 2.7

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



[issue16986] ElementTree incorrectly parses strings with declared encoding not UTF-8

2013-05-22 Thread Eli Bendersky

Eli Bendersky added the comment:

Agreed re 2.7; the problem is not important enough to warrant such a backport, 
due to the state of maintenance of 2.7 at this point.

--

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




[issue16986] ElementTree incorrectly parses strings with declared encoding not UTF-8

2013-03-04 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Eli, this issue no longer has open pre-requisites. Issue10590 was replaced by 
issue17089 which closed now. Issue17089 fixed Python interface to expat parser, 
but cElementTree uses C interface of expat directly and the proposed pathes fix 
it.

--

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



[issue16986] ElementTree incorrectly parses strings with declared encoding not UTF-8

2013-02-25 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Here is a patch for C implementation. Python implementation was fixed in 
issue17089.

--
dependencies: +Expat parser parses strings only when XML encoding is UTF-8 
-Parameter type error for xml.sax.parseString(string, ...)
keywords: +patch
Added file: http://bugs.python.org/file29233/etree_parse_str.patch

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



[issue16986] ElementTree incorrectly parses strings with declared encoding not UTF-8

2013-01-17 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

 import xml.etree.ElementTree
 data = '?xml version=1.0 encoding=iso-8859-1?\nmoney 
 value=$\xa3\u20ac\U0001017b$\xa3\u20ac\U0001017b/money'
 xml.etree.ElementTree.tostring(xml.etree.ElementTree.fromstring(data), 
 'unicode')
'money value=$£â\x82¬ð\x90\x85»$£â\x82¬ð\x90\x85»/money'

--
components: XML
messages: 180143
nosy: eli.bendersky, serhiy.storchaka
priority: normal
severity: normal
stage: needs patch
status: open
title: ElementTree incorrectly parses strings with declared encoding not UTF-8
type: behavior
versions: Python 2.7, Python 3.2, Python 3.3, Python 3.4

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



[issue16986] ElementTree incorrectly parses strings with declared encoding not UTF-8

2013-01-17 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Patch for issue10590 fixes this for Python implementation of ElementTree, but 
not for C implementation.

--
dependencies: +Parameter type error for xml.sax.parseString(string, ...)

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