[NumPy-Tickets] [NumPy] #1388: numpy.frombuffer calls PyErr_Format without actually throwing the error, causing bizarre errors later

NumPy Trac numpy-tickets@scipy....
Mon Feb 8 11:07:33 CST 2010


#1388: numpy.frombuffer calls PyErr_Format without actually throwing the error,
causing bizarre errors later
------------------------+---------------------------------------------------
 Reporter:  baffe       |       Owner:  somebody
     Type:  defect      |      Status:  new     
 Priority:  normal      |   Milestone:          
Component:  numpy.core  |     Version:  1.4.0   
 Keywords:              |  
------------------------+---------------------------------------------------

Comment(by charris):

 This was fixed in r8085.


 {{{
 In [1]: buf = numpy.frombuffer('', 'B')
 ---------------------------------------------------------------------------
 ValueError                                Traceback (most recent call
 last)

 /home/charris/<ipython console> in <module>()

 ValueError: offset must be non-negative and smaller than buffer lenth (0)

 }}}

 The check still doesn't allow zero sized buffers.

-- 
Ticket URL: <http://projects.scipy.org/numpy/ticket/1388#comment:2>
NumPy <http://projects.scipy.org/numpy>
My example project


More information about the NumPy-Tickets mailing list