Permalink
Browse files

BUG:py3k: fix error with recarry. Patch by C. Gohlke. Closes #1843.

  • Loading branch information...
rgommers authored and charris committed Jun 22, 2011
1 parent 494cc99 commit 5e4a4075a8476a6c6d46481f33a4c873f545d4c7
Showing with 3 additions and 1 deletion.
  1. +1 −1 numpy/compat/py3k.py
  2. +2 −0 numpy/core/tests/test_records.py
View
@@ -23,7 +23,7 @@ def asstr(s):
return s
return s.decode('latin1')
def isfileobj(f):
- return isinstance(f, io.FileIO)
+ return isinstance(f, (io.FileIO, io.BufferedReader))
def open_latin1(filename, mode='r'):
return open(filename, mode=mode, encoding='iso-8859-1')
strchar = 'U'
@@ -41,6 +41,8 @@ def test_recarray_fromfile(self):
fd = open(filename, 'rb')
fd.seek(2880 * 2)
r = np.rec.fromfile(fd, formats='f8,i4,a5', shape=3, byteorder='big')
+ fd.seek(2880 * 2)
+ r = np.rec.array(fd, formats='f8,i4,a5', shape=3, byteorder='big')
def test_recarray_from_obj(self):
count = 10

0 comments on commit 5e4a407

Please sign in to comment.