summaryrefslogtreecommitdiff
path: root/numpy/lib/npyio.py
diff options
context:
space:
mode:
authorCharles Harris <charlesr.harris@gmail.com>2011-04-05 10:05:40 -0600
committerCharles Harris <charlesr.harris@gmail.com>2011-04-05 10:05:40 -0600
commitcff9ccb8340d7f4efcd721e1fd9ce36be27e337d (patch)
treebe1b998a4a1b9eb309c1f596438cf8d8b9f2f3dd /numpy/lib/npyio.py
parentb48b2d5d73dbeef466d6c0a8b41d65d844d7b264 (diff)
downloadnumpy-cff9ccb8340d7f4efcd721e1fd9ce36be27e337d.tar.gz
BUG: Workaround for the fact the Python 2.4 doesn't accept 'Ub' as a file
mode, but does accept 'rbU'. Note that with either of these modes Python 3 fails to split files with '\r' line endings on linux. This is either a bug in Python 3 or something that requires more extensive modifications to genfromtxt. Because genfromtxt now accepts generators it should be possible to write a generator that opens files in text mode and encodes the lines as byte streams, and this should provide a workaround.
Diffstat (limited to 'numpy/lib/npyio.py')
-rw-r--r--numpy/lib/npyio.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/numpy/lib/npyio.py b/numpy/lib/npyio.py
index c74157ea2..1dadc0d1a 100644
--- a/numpy/lib/npyio.py
+++ b/numpy/lib/npyio.py
@@ -1232,7 +1232,7 @@ def genfromtxt(fname, dtype=float, comments='#', delimiter=None,
own_fhd = False
try:
if isinstance(fname, basestring):
- fhd = iter(np.lib._datasource.open(fname, 'Ub'))
+ fhd = iter(np.lib._datasource.open(fname, 'rbU'))
own_fhd = True
else:
fhd = iter(fname)