[issue25659] ctypes.Array.from_buffer segmentation fault when trying to create from array.array

2017-03-31 Thread Donald Stufft
Changes by Donald Stufft : -- pull_requests: +1006 ___ Python tracker ___ ___

[issue25659] ctypes.Array.from_buffer segmentation fault when trying to create from array.array

2016-11-20 Thread Martin Panter
Changes by Martin Panter : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue25659] ctypes.Array.from_buffer segmentation fault when trying to create from array.array

2016-11-20 Thread Roundup Robot
Roundup Robot added the comment: New changeset 5f061870d49c by Martin Panter in branch '3.5': Issue #25659: Change assert to TypeError in from_buffer/_copy() https://hg.python.org/cpython/rev/5f061870d49c New changeset 1253ef20c947 by Martin Panter in branch '3.6': Issue #25659: Merge ctypes

[issue25659] ctypes.Array.from_buffer segmentation fault when trying to create from array.array

2016-11-18 Thread Martin Panter
Martin Panter added the comment: Here is a patch implementing Eryk’s suggestion, for both from_buffer() and from_buffer_copy() methods. This is exactly how it is already handled for Array.from_address(). The two buffer methods were added more recently than from_address(). --

[issue25659] ctypes.Array.from_buffer segmentation fault when trying to create from array.array

2015-11-18 Thread Ely Spears
New submission from Ely Spears: I'm trying to find a way to create a ctypes array from the underlying memory buffer exposed by an array.array object. The ctypes.Array.from_buffer function isn't documented, but I did find the source code in _ctypes.c around line 497. It's not clear to me where

[issue25659] ctypes.Array.from_buffer segmentation fault when trying to create from array.array

2015-11-18 Thread Eryk Sun
Eryk Sun added the comment: You have to subclass ctypes.Array with a _type_ and _length_. But ctypes types also implement sequence repetition (*) to facilitate creating array types. For example: import array, ctypes a1 = array.array('l') a1.fromlist(range(10)) c1 =

[issue25659] ctypes.Array.from_buffer segmentation fault when trying to create from array.array

2015-11-18 Thread Xiang Zhang
Changes by Xiang Zhang <18518281...@126.com>: -- nosy: +xiang.zhang ___ Python tracker ___ ___