[pypy-commit] pypy unicode-utf8-py3: merge py3.5 into branch
mattip
pypy.commits at gmail.com
Wed Sep 5 08:10:32 EDT 2018
Author: Matti Picus <matti.picus at gmail.com>
Branch: unicode-utf8-py3
Changeset: r95080:a0b258c2d6e0
Date: 2018-09-02 17:14 +0200
http://bitbucket.org/pypy/pypy/changeset/a0b258c2d6e0/
Log: merge py3.5 into branch
diff --git a/pypy/module/_csv/interp_reader.py b/pypy/module/_csv/interp_reader.py
--- a/pypy/module/_csv/interp_reader.py
+++ b/pypy/module/_csv/interp_reader.py
@@ -73,6 +73,9 @@
break
raise
self.line_num += 1
+ if space.isinstance_w(w_line, space.w_bytes):
+ raise self.error(u"iterator should return strings, not bytes "
+ u"(did you open the file in text mode?")
line = space.realunicode_w(w_line)
for c in line:
if c == b'\0':
diff --git a/pypy/module/_csv/test/test_reader.py b/pypy/module/_csv/test/test_reader.py
--- a/pypy/module/_csv/test/test_reader.py
+++ b/pypy/module/_csv/test/test_reader.py
@@ -33,7 +33,7 @@
def test_cannot_read_bytes(self):
import _csv
reader = _csv.reader([b'foo'])
- raises((TypeError, _csv.Error), next, reader)
+ raises(_csv.Error, next, reader)
def test_read_oddinputs(self):
self._read_test([], [])
More information about the pypy-commit
mailing list