[issue12834] memorview.to_bytes() and PyBuffer_ToContiguous() incorrect for non-contiguous arrays

2012-07-29 Thread Stefan Krah

Stefan Krah added the comment:

Christian's posts and my initial report were about memoryview.tobytes(). It's
good that you changed the title: memoryview.tobytes() is more meaningful than
the slightly obscure PyBuffer_ToContiguous().


BTW, I'm sure that PyBuffer_FromContiguous() and PyObject_CopyData() have the
same problem, but they aren't used in the Python source tree and they are
undocumented.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12834
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12834] memorview.to_bytes() and PyBuffer_ToContiguous() incorrect for non-contiguous arrays

2012-07-28 Thread Nick Coghlan

Nick Coghlan added the comment:

Was the point that memoryview.tobytes() has a known data corruption bug in 3.2 
and 2.7 raised in the previous discussion? I'm pretty sure I had forgotten 
about it, and I don't remember it coming up in the thread.

The trickiest aspect of a backport of the new implementation is that we need to 
preserve the C ABI - extensions compiled against any maintenance release should 
work with all maintenance releases in that series.

The new APIs aren't a major problem - just sprinkle a few underscores around to 
mark them as private on the older versions (I've certainly done that before 
when a bug fix genuinely needed something that qualified as a new feature: 
implemented a private version to use in fixing the bug on the maintenance 
branch, then promote that to a public API on trunk)

--
priority: normal - high
title: PyBuffer_ToContiguous() incorrect for non-contiguous arrays - 
memorview.to_bytes() and PyBuffer_ToContiguous() incorrect for non-contiguous 
arrays

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12834
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com