[issue17915] Encoding error with sax and codecs

2013-05-12 Thread Simon Conseil
Simon Conseil added the comment: thanks everybody ! -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://m

[issue17915] Encoding error with sax and codecs

2013-05-12 Thread Georg Brandl
Georg Brandl added the comment: Fixed in 3.2, 3.3 and default. -- resolution: -> fixed status: open -> closed ___ Python tracker ___

[issue17915] Encoding error with sax and codecs

2013-05-12 Thread Roundup Robot
Roundup Robot added the comment: New changeset 1c01571ce0f4 by Georg Brandl in branch '3.2': Issue #17915: Fix interoperability of xml.sax with file objects returned by http://hg.python.org/cpython/rev/1c01571ce0f4 -- nosy: +python-dev ___ Python trac

[issue17915] Encoding error with sax and codecs

2013-05-07 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Perhaps we should add a deprecation warning for codecs streams right in this patch? -- ___ Python tracker ___ ___

[issue17915] Encoding error with sax and codecs

2013-05-07 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Of course, if this patch will be committed, perhaps it will be worth to apply it also for 3.2 which has the same regression. -- components: +XML stage: needs patch -> patch review versions: +Python 3.2 ___ Python t

[issue17915] Encoding error with sax and codecs

2013-05-07 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Here is a patch which adds explicit checks for codecs stream writers and adds tests for these cases. The tests are not entirely honest, they test only that XMLGenerator works with some specially prepared streams. XMLGenerator doesn't work with a stream with

[issue17915] Encoding error with sax and codecs

2013-05-07 Thread STINNER Victor
STINNER Victor added the comment: > Accepting of text streams in XMLGenerator should be deprecated in future > versions. I agree that the following pattern is strange: with codecs.open('/tmp/test.txt', 'w', encoding='iso-8859-1') as f: xml = XMLGenerator(f, encoding='iso-8859-1') Why would

[issue17915] Encoding error with sax and codecs

2013-05-07 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: It is not working fine on Python 3.3.0. >>> with codecs.open('/tmp/test.txt', 'w', encoding='iso-8859-1') as f: ... xml = XMLGenerator(f, encoding='iso-8859-1') ... xml.startDocument() ... xml.startElement('root', {'attr': u'\u20ac'}) ... xml.e

[issue17915] Encoding error with sax and codecs

2013-05-06 Thread STINNER Victor
STINNER Victor added the comment: Extracted test from report.txt. Test with Python 3.4: $ ./python test_codecs.py Traceback (most recent call last): File "test_codecs.py", line 7, in xml.startDocument() File "/home/haypo/prog/python/default/Lib/xml/sax/saxutils.py", line 148, in start

[issue17915] Encoding error with sax and codecs

2013-05-06 Thread STINNER Victor
STINNER Victor added the comment: It looks like a regression of introduced by the fix of the issue #1470548, changeset 66f92f76b2ce. -- ___ Python tracker ___ __

[issue17915] Encoding error with sax and codecs

2013-05-06 Thread Antoine Pitrou
Antoine Pitrou added the comment: Since this is a regression, setting (temporarily perhaps) as release blocker. -- nosy: +georg.brandl, larry, pitrou priority: normal -> release blocker stage: -> needs patch ___ Python tracker

[issue17915] Encoding error with sax and codecs

2013-05-06 Thread Antoine Pitrou
Changes by Antoine Pitrou : -- nosy: +haypo, serhiy.storchaka type: -> behavior versions: +Python 3.4 ___ Python tracker ___ ___ Pyth

[issue17915] Encoding error with sax and codecs

2013-05-06 Thread Simon Conseil
New submission from Simon Conseil: There is an encoding issue between codecs.open and sax (see attached file). The issue is reproducible on Python 3.3.1, it is working fine on Python 3.3.0 -- components: Library (Lib) files: report.txt messages: 188508 nosy: sconseil priority: normal se