[issue25270] codecs.escape_encode systemerror on empty byte string

2017-03-31 Thread Donald Stufft
Changes by Donald Stufft : -- pull_requests: +1076 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail

[issue25270] codecs.escape_encode systemerror on empty byte string

2016-09-16 Thread Berker Peksag
Berker Peksag added the comment: Thanks for the reviews everyone! -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___ _

[issue25270] codecs.escape_encode systemerror on empty byte string

2016-09-16 Thread Roundup Robot
Roundup Robot added the comment: New changeset 2a4fb01fa1a3 by Berker Peksag in branch '3.5': Issue #25270: Prevent codecs.escape_encode() from raising SystemError when an empty bytestring is passed https://hg.python.org/cpython/rev/2a4fb01fa1a3 New changeset 8a649009a0e9 by Berker Peksag in br

[issue25270] codecs.escape_encode systemerror on empty byte string

2016-09-16 Thread Berker Peksag
Berker Peksag added the comment: Thanks for the review, Serhiy. Here's an updated patch. -- Added file: http://bugs.python.org/file44691/issue25270_v3.diff ___ Python tracker ___

[issue25270] codecs.escape_encode systemerror on empty byte string

2016-09-16 Thread Berker Peksag
Berker Peksag added the comment: Here is an updated patch. -- versions: +Python 3.7 Added file: http://bugs.python.org/file44689/issue25270_v2.diff ___ Python tracker ___ ___

[issue25270] codecs.escape_encode systemerror on empty byte string

2015-12-19 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- versions: -Python 3.4 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https:/

[issue25270] codecs.escape_encode systemerror on empty byte string

2015-10-01 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: On 30.09.2015 15:11, Serhiy Storchaka wrote: > May be better to test a condition "size > 0" before calling > _PyBytes_Resize(), as in many other case where _PyBytes_Resize() is used. > > Or accept shared objects in _PyBytes_Resize() if new size is equal to

[issue25270] codecs.escape_encode systemerror on empty byte string

2015-10-01 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: On 01.10.2015 04:35, Martin Panter wrote: > For the record, because I was curious: Function codecs.escape_encode() is not > documented, and barely tested. It was used for the documented “string_escape” > codec in Python 2, but this codec was removed for Pyt

[issue25270] codecs.escape_encode systemerror on empty byte string

2015-09-30 Thread Martin Panter
Martin Panter added the comment: The patch looks sufficient to fix the problem, though I do like Serhiy’s suggestions. For the record, because I was curious: Function codecs.escape_encode() is not documented, and barely tested. It was used for the documented “string_escape” codec in Python 2,

[issue25270] codecs.escape_encode systemerror on empty byte string

2015-09-30 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: May be better to test a condition "size > 0" before calling _PyBytes_Resize(), as in many other case where _PyBytes_Resize() is used. Or accept shared objects in _PyBytes_Resize() if new size is equal to old size. This will allow to getrid of additional test

[issue25270] codecs.escape_encode systemerror on empty byte string

2015-09-30 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: The patch looks fine to me, but I still wonder how p - PyBytes_AS_STRING(v) can be negative when size == 0... Ah, now I get it: the new size is 0, but the refcount is not 1, since the nullstring is shared. This causes the exception. >From _PyBytes_Resize(

[issue25270] codecs.escape_encode systemerror on empty byte string

2015-09-29 Thread Benjamin Peterson
Benjamin Peterson added the comment: IMO, the "if (size == 0)" logic should be moved down several lines to avoid introducing a redundant "PyBytes_FromStringAndSize" call. -- nosy: +benjamin.peterson ___ Python tracker

[issue25270] codecs.escape_encode systemerror on empty byte string

2015-09-29 Thread Berker Peksag
Changes by Berker Peksag : -- components: +Extension Modules -Interpreter Core keywords: +patch nosy: +berker.peksag stage: needs patch -> patch review versions: +Python 3.6 -Python 3.2, Python 3.3 Added file: http://bugs.python.org/file40623/issue25270.diff

[issue25270] codecs.escape_encode systemerror on empty byte string

2015-09-29 Thread Bruno Oliveira
Changes by Bruno Oliveira : -- nosy: +Bruno Oliveira ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://ma

[issue25270] codecs.escape_encode systemerror on empty byte string

2015-09-29 Thread Zachary Ware
Changes by Zachary Ware : -- nosy: +The Compiler, doerwalter, lemburg stage: -> needs patch ___ Python tracker ___ ___ Python-bugs-li

[issue25270] codecs.escape_encode systemerror on empty byte string

2015-09-29 Thread Paul Kehrer
New submission from Paul Kehrer: Python 3.5.0 (default, Sep 13 2015, 10:33:07) [GCC 4.2.1 Compatible Apple LLVM 6.1.0 (clang-602.0.53)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import codecs >>> codecs.escape_encode(b'') Traceback (most recent call las