Skip to content

Commit 5a4bcc1

Browse files
committed
MAINT: Prefer FS encoding over UTF-8
1 parent 987d5b0 commit 5a4bcc1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pandas/io/parsers.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1315,7 +1315,8 @@ def _validate_usecols_arg(usecols):
13151315
# see gh-13253
13161316
#
13171317
# Python 2.x compatibility
1318-
usecols = {col.encode("utf-8") for col in usecols}
1318+
encoding = sys.getfilesystemencoding() or "utf-8"
1319+
usecols = {col.encode(encoding) for col in usecols}
13191320

13201321
return usecols, usecols_dtype
13211322
return usecols, None

0 commit comments

Comments
 (0)