Serhiy Storchaka added the comment:

These were not idle questions.  I wrote the patch, and I had to know what 
behavior is correct.

Here's the patch.  It fixes potential memory bug (unconsumed_tail sets to NULL 
in case of out of memory), resets the unconsumed_tail to b'' after EOF, updates 
unconsumed_tail and unused_data in flush().

I a little changed test for the previous case (here was O(N^2) for large data). 
 I checked it on non-fixed Python, bug was catched.

----------
stage: committed/rejected -> patch review
status: closed -> open

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue16350>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to