[Numpy-discussion] Segfault using "fromstring" and reading variable length string

Gökhan Sever gokhansever at gmail.com
Sun Apr 24 18:32:19 EDT 2011


On Fri, Apr 22, 2011 at 6:32 PM, Mark Wiebe <mwwiebe at gmail.com> wrote:

> I took a quick look at this issue and committed a fix. PyArray_FromString
> was doing a check to exclude object arrays, but that check was incorrect.
> Now it should appropriately raise an exception instead of creating an
> invalid array.
>
>
> https://github.com/numpy/numpy/commit/f75bfab3a2ab74ac82047f153a36c71c58fe3732
>
> -Mark
>

Thanks for the fix.

Now that line yields:

I[6]: k = np.fromstring(c.read(dt.itemsize), dt)[0]
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)

/home/gsever/Desktop/python-repo/numpy/<ipython console> in <module>()

ValueError: Cannot create an object array from a string


-- 
Gökhan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20110424/ed162070/attachment.html>


More information about the NumPy-Discussion mailing list