[NumPy-Tickets] [NumPy] #1610: fromfile/tofile mess up file handle position on Python 3

NumPy Trac numpy-tickets@scipy....
Sat Sep 11 10:32:40 CDT 2010


#1610: fromfile/tofile mess up file handle position on Python 3
------------------------+---------------------------------------------------
 Reporter:  pv          |       Owner:  somebody
     Type:  defect      |      Status:  new     
 Priority:  normal      |   Milestone:  1.5.1   
Component:  numpy.core  |     Version:  1.5.0   
 Keywords:              |  
------------------------+---------------------------------------------------
 {{{
 >>> import numpy as np
 >>> f = open('foo.dat', 'w+b')
 >>> f.write(np.arange(255, dtype='u1').tostring())
 255
 >>> f.seek(0)
 0
 >>> np.fromfile(f, dtype='u1', count=4)
 array([0, 1, 2, 3], dtype=uint8)
 >>> f.tell()
 255
 }}}

-- 
Ticket URL: <http://projects.scipy.org/numpy/ticket/1610>
NumPy <http://projects.scipy.org/numpy>
My example project


More information about the NumPy-Tickets mailing list