From 75f99ab7dcc846c58a088a9233fb9af28aef0b4a Mon Sep 17 00:00:00 2001 From: Pauli Virtanen Date: Sat, 8 May 2010 16:34:39 +0000 Subject: BUG: lib: make loadtxt work on Py3 when fh returns unicode (fixes #1479) --- numpy/lib/npyio.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'numpy/lib/npyio.py') diff --git a/numpy/lib/npyio.py b/numpy/lib/npyio.py index a6e941770..a1c55b23f 100644 --- a/numpy/lib/npyio.py +++ b/numpy/lib/npyio.py @@ -608,7 +608,7 @@ def loadtxt(fname, dtype=float, comments='#', delimiter=None, def split_line(line): """Chop off comments, strip, and split at delimiter.""" - line = line.split(comments)[0].strip() + line = asbytes(line).split(comments)[0].strip() if line: return line.split(delimiter) else: -- cgit v1.2.1