[issue28408] Fix redundant code and memory leak in _PyUnicodeWriter_Finish

2016-10-25 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- resolution: -> fixed stage: commit review -> resolved status: open -> closed ___ Python tracker ___

[issue28408] Fix redundant code and memory leak in _PyUnicodeWriter_Finish

2016-10-25 Thread Roundup Robot
Roundup Robot added the comment: New changeset 9d618cebfc21 by Serhiy Storchaka in branch '3.6': Issue #28408: Fixed a leak and remove redundant code in _PyUnicodeWriter_Finish(). https://hg.python.org/cpython/rev/9d618cebfc21 New changeset 24c3f997bd1a by Serhiy Storchaka in branch 'default':

[issue28408] Fix redundant code and memory leak in _PyUnicodeWriter_Finish

2016-10-25 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: 3.5 is free from both problems. They were introduced in f33433d9c163. -- versions: -Python 3.5 ___ Python tracker ___ ___

[issue28408] Fix redundant code and memory leak in _PyUnicodeWriter_Finish

2016-10-25 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: LGTM. -- assignee: -> serhiy.storchaka stage: patch review -> commit review ___ Python tracker ___ __

[issue28408] Fix redundant code and memory leak in _PyUnicodeWriter_Finish

2016-10-10 Thread Xiang Zhang
New submission from Xiang Zhang: _PyUnicodeWriter_Finish gets 2 problems now: 1. It has two same branches handling empty strings which is redundant. 2. It may leak the inner buffer object when resize_compact fails. When resize_compact fails, the buffer object is left untouched. Then the writer