Skip to content

Commit a7d5ac7

Browse files
author
y-p
committed
BUG: specify 'strict' parsing in csv.reader #2331
python changed behaviour, possibly http://bugs.python.org/issue16013
1 parent d5f10fa commit a7d5ac7

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

pandas/io/parsers.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1145,9 +1145,11 @@ class MyDialect(csv.Dialect):
11451145

11461146
if self.encoding is not None:
11471147
reader = com.UnicodeReader(f, dialect=dia,
1148-
encoding=self.encoding)
1148+
encoding=self.encoding,
1149+
strict=True)
11491150
else:
1150-
reader = csv.reader(f, dialect=dia)
1151+
reader = csv.reader(f, dialect=dia,
1152+
strict=True)
11511153
else:
11521154
reader = (re.split(sep, line.strip()) for line in f)
11531155

0 commit comments

Comments
 (0)