[issue16979] Broken error handling in codecs.unicode_escape_decode()

2013-01-29 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- resolution: -> fixed stage: patch review -> committed/rejected status: open -> closed ___ Python tracker ___ ___

[issue16979] Broken error handling in codecs.unicode_escape_decode()

2013-01-29 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Until subtests added an explicit call looks better to me. And when subtests will be added we will just add subtest inside the helper function. -- ___ Python tracker

[issue16979] Broken error handling in codecs.unicode_escape_decode()

2013-01-29 Thread Roundup Robot
Roundup Robot added the comment: New changeset a242ac99161f by Serhiy Storchaka in branch '2.7': Issue #16979: Fix error handling bugs in the unicode-escape-decode decoder. http://hg.python.org/cpython/rev/a242ac99161f New changeset 084bec5443d6 by Serhiy Storchaka in branch '3.2': Issue #16979:

[issue16979] Broken error handling in codecs.unicode_escape_decode()

2013-01-28 Thread Ezio Melotti
Ezio Melotti added the comment: LGTM. If you want to push it even further you could make a list of (input, expected) and call the check() in a loop. That way it will also be easier to refactor if/when we add subtests (#16997). -- ___ Python tracker

[issue16979] Broken error handling in codecs.unicode_escape_decode()

2013-01-28 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Ezio, is it a good factorization? def check(self, coder): def checker(input, expect): self.assertEqual(coder(input), (expect, len(input))) return checker def test_escape_decode(self): decode = codecs.unicode_escape_

[issue16979] Broken error handling in codecs.unicode_escape_decode()

2013-01-25 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Here is a set of patches for all versions (patch for 3.4 updated). -- Added file: http://bugs.python.org/file28833/unicode_escape_decode_error_handling-2.7.patch Added file: http://bugs.python.org/file28834/unicode_escape_decode_error_handling-3.2.pa

[issue16979] Broken error handling in codecs.unicode_escape_decode()

2013-01-25 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : Removed file: http://bugs.python.org/file28752/unicode_escape_decode_error_handling-3.4.patch ___ Python tracker ___ __

[issue16979] Broken error handling in codecs.unicode_escape_decode()

2013-01-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Here is a patch for 3.4. Patches for other versions will be different a lot. -- dependencies: +SystemError in codecs.unicode_escape_decode() keywords: +patch stage: needs patch -> patch review Added file: http://bugs.python.org/file28752/unicode_escap

[issue16979] Broken error handling in codecs.unicode_escape_decode()

2013-01-16 Thread Serhiy Storchaka
New submission from Serhiy Storchaka: An error handler in unicode_escape_decode() eats at least one byte (or more) after illegal escape sequence. >>> import codecs >>> codecs.unicode_escape_decode(br'\u!@#', 'replace') ('�', 5) >>> codecs.unicode_escape_decode(br'\u!@#$', 'replace') ('�@#$', 6)