Thanks to visit codestin.com
Credit goes to github.com

Skip to content

ENH: NumPy could accept PIL-style buffers (if it copies the data!)  #5412

Open
@abalkin

Description

@abalkin

I encountered this error in my own extension module, but it can be easily demonstrated using the _tesbuffer module that is included with Python 3.4:

>>> import _testbuffer, numpy
>>> nd = _testbuffer.ndarray(list(range(6)), shape=[2,3],
...                          format='i', flags=_testbuffer.ND_PIL)
>>> numpy.array(nd)
array([[-1974954736,       32754, -1974954724],
       [-1974954724,       32754,           0]], dtype=int32)

It looks like numpy fails to implement proper pointer dereferencing in the presence of suboffsets. In this case

>>> nd.suboffsets
(0, -1)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions