Skip to content

Commit 0efe18b

Browse files
committed
Address review comments
1 parent 6ed3a2e commit 0efe18b

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

doc/source/whatsnew/v0.19.0.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ API changes
271271
- ``__setitem__`` will no longer apply a callable rhs as a function instead of storing it. Call ``where`` directly to get the previous behavior. (:issue:`13299`)
272272
- Passing ``Period`` with multiple frequencies to normal ``Index`` now returns ``Index`` with ``object`` dtype (:issue:`13664`)
273273
- ``PeriodIndex.fillna`` with ``Period`` has different freq now coerces to ``object`` dtype (:issue:`13664`)
274-
274+
- More informative exceptions are passed through the parser. The exception type would now be the original exception type instead of ``CParserError``. (:issue `13652`)
275275

276276
.. _whatsnew_0190.api.tolist:
277277

pandas/io/tests/parser/common.py

+6
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,11 @@ def test_empty_decimal_marker(self):
4747
self.read_csv(StringIO(data), decimal='')
4848

4949
def test_bad_stream_exception(self):
50+
# Issue 13652:
51+
# This test validates that both python engine
52+
# and C engine will raise UnicodeDecodeError instead of
53+
# c engine raising CParserError and swallowing exception
54+
# that caused read to fail.
5055
handle = open(self.csv_shiftjs, "rb")
5156
codec = codecs.lookup("utf-8")
5257
utf8 = codecs.lookup('utf-8')
@@ -60,6 +65,7 @@ def test_bad_stream_exception(self):
6065
msg = "'utf8' codec can't decode byte"
6166
with tm.assertRaisesRegexp(UnicodeDecodeError, msg):
6267
self.read_csv(stream)
68+
stream.close()
6369

6470
def test_read_csv(self):
6571
if not compat.PY3:

0 commit comments

Comments
 (0)