Serhiy Storchaka added the comment:

The bytearray object allocates one byte more for trailing null byte. ob_size 
always should be less than ob_alloc if ob_alloc != 0. But in rare cases when 
the bytearray is initialized with an iterator, this rule can be violated. 
Following patch restores this property. PyByteArray_AS_STRING() now always 
returns null-terminated string.

Added file:

Python tracker <>
Python-bugs-list mailing list

Reply via email to