Skip to content

Commit 8e05f7e

Browse files
committed
BUG: _read encoding fix
change encoding to lowercase sub - for _ see pandas-dev#13549
1 parent a2f178f commit 8e05f7e

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

pandas/io/parsers.py

+3
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,9 @@ def _validate_nrows(nrows):
350350
def _read(filepath_or_buffer, kwds):
351351
"Generic reader of line files."
352352
encoding = kwds.get('encoding', None)
353+
if encoding is not None:
354+
encoding = re.sub('_', '-', encoding).lower()
355+
kwds['encoding'] = encoding
353356

354357
# If the input could be a filename, check for a recognizable compression
355358
# extension. If we're reading from a URL, the `get_filepath_or_buffer`

0 commit comments

Comments
 (0)