New submission from Richard Hansen:
PyBuffer_ToContiguous() has an off-by-one error when copying a buffer it thinks
is non-contiguous.
To reproduce, put the following in foo.pyx and compile with Cython v0.21.2:
cpdef foo():
cdef unsigned char[:] v = bytearray("testing")
print repr(memoryview(v).tobytes())
>>> import foo
>>> foo.foo()
'estingt'
(This issue was fixed for Python 3.x in issue #12834 but it was not fixed for
Python 2.7.)
----------
components: Interpreter Core
files: PyBuffer_ToContiguous.patch
keywords: patch
messages: 235011
nosy: rhansen
priority: normal
severity: normal
status: open
title: memoryview.to_bytes() and PyBuffer_ToContiguous() off-by-one error for
non-contiguous buffers
type: behavior
versions: Python 2.7
Added file: http://bugs.python.org/file37912/PyBuffer_ToContiguous.patch
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue23349>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com