RE: [Numpy-discussion] fromstring doesn't accept buffer object
![](https://secure.gravatar.com/avatar/7dd64dbe40f809b9f8276bde56c872fd.jpg?s=120&d=mm&r=g)
Sorry for mixing test and production systems: There is no problem here with python 2.3, I got this failure with python 2.4a2: ========================================== import numarray as n import Numeric as N s = '12341234' b = buffer(s) print 'numarray: fromstring (string ..) :' print n.fromstring(s, type=n.Float64) print 'Numeric: fromstring (string ..) :' print N.fromstring(s, typecode=N.Float64) print 'Numeric: fromstring (buffer ..) :' print N.fromstring(b, typecode=N.Float64) print 'numarray: fromstring (buffer ..) :' print n.fromstring(b, type=n.Float64) === Results: ==== numarray: fromstring (string ..) : [ 3.05810932e-57] Numeric: fromstring (string ..) : [ 3.05810932e-57] Numeric: fromstring (buffer ..) : [ 3.05810932e-57] === This error happens only with Python 2.4.a2: numarray: fromstring (buffer ..) : Traceback (most recent call last): File "test.py", line 17, in ? print n.fromstring(b, type=n.Float64) File "/usr/local/lib/python2.4/site-packages/numarray/numarraycore.py", line 378, in fromstring arr._data, 0, (type.bytes,), type.bytes) libnumarray.error: copyNbytes: access beyond buffer. offset=7 buffersize=0 Nadav. -----Original Message----- From: Todd Miller [mailto:jmiller@stsci.edu] Sent: Thu 26-Aug-04 15:51 To: Nadav Horesh Cc: numpy-discussion Subject: Re: [Numpy-discussion] fromstring doesn't accept buffer object This is what I see this morning using CVS:
What kind of failure are you seeing? Regards, Todd On Thu, 2004-08-26 at 09:28, Nadav Horesh wrote:
participants (1)
-
Nadav Horesh