This issue tracker has been migrated to GitHub ,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
Created on 2015年01月30日 01:07 by rhansen, last changed 2022年04月11日 14:58 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| PyBuffer_ToContiguous.patch | rhansen, 2015年01月30日 01:07 | patch that fixes this bug | ||
| issue23349-2.diff | skrah, 2015年01月30日 17:20 | |||
| Messages (4) | |||
|---|---|---|---|
| msg235011 - (view) | Author: Richard Hansen (rhansen) * | Date: 2015年01月30日 01:07 | |
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.)
|
|||
| msg235042 - (view) | Author: Stefan Krah (skrah) * (Python committer) | Date: 2015年01月30日 17:20 | |
Looks good, here's a patch with tests. |
|||
| msg235048 - (view) | Author: Roundup Robot (python-dev) (Python triager) | Date: 2015年01月30日 19:11 | |
New changeset a9305102c892 by Stefan Krah in branch '2.7': Issue #23349: Fix off-by-one error in PyBuffer_ToContiguous(). Initial patch https://hg.python.org/cpython/rev/a9305102c892 |
|||
| msg235109 - (view) | Author: Stefan Krah (skrah) * (Python committer) | Date: 2015年01月31日 14:26 | |
Should be fixed, thanks for the patch. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:58:12 | admin | set | github: 67538 |
| 2015年01月31日 14:26:07 | skrah | set | status: open -> closed resolution: fixed messages: + msg235109 stage: resolved |
| 2015年01月30日 19:11:50 | python-dev | set | nosy:
+ python-dev messages: + msg235048 |
| 2015年01月30日 17:20:18 | skrah | set | files:
+ issue23349-2.diff messages: + msg235042 |
| 2015年01月30日 14:35:07 | skrah | set | nosy:
+ skrah |
| 2015年01月30日 06:30:12 | rhansen | set | title: memoryview.to_bytes() and PyBuffer_ToContiguous() off-by-one error for non-contiguous buffers -> PyBuffer_ToContiguous() off-by-one error for non-contiguous buffers |
| 2015年01月30日 01:07:08 | rhansen | create | |