Skip to content

Commit 816452a

Browse files
committed
Address comments by @jreback
1 parent c3a1d15 commit 816452a

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

doc/source/whatsnew/v0.25.0.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,6 @@ Bug Fixes
141141
- Bug in :func:`to_datetime` which would raise an (incorrect) ``ValueError`` when called with a date far into the future and the ``format`` argument specified instead of raising ``OutOfBoundsDatetime`` (:issue:`23830`)
142142
- Bug in an error message in :meth:`DataFrame.plot`. Improved the error message if non-numerics are passed to :meth:`DataFrame.plot` (:issue:`25481`)
143143
- Bug in error messages in :meth:`DataFrame.corr` and :meth:`Series.corr`. Added the possibility of using a callable. (:issue:`25729`)
144-
- Bug in `TextReader()` not properly working with UTF8 on Windows on Python 3.6+ (fix for :issue:`15086` instead of a workaround)
145144

146145
Categorical
147146
^^^^^^^^^^^
@@ -236,6 +235,7 @@ I/O
236235
- Bug in :func:`json_normalize` for ``errors='ignore'`` where missing values in the input data, were filled in resulting ``DataFrame`` with the string "nan" instead of ``numpy.nan`` (:issue:`25468`)
237236
- :meth:`DataFrame.to_html` now raises ``TypeError`` when using an invalid type for the ``classes`` parameter instead of ``AsseertionError`` (:issue:`25608`)
238237
- Bug in :meth:`DataFrame.to_string` and :meth:`DataFrame.to_latex` that would lead to incorrect output when the ``header`` keyword is used (:issue:`16718`)
238+
- Bug in :func:`read_csv` not properly interpreting the UTF8 encoded filenames on Windows on Python 3.6+ (:issue:`15086`)
239239
-
240240

241241

pandas/tests/io/parser/test_common.py

+5-6
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
specific classification into the other test modules.
66
"""
77

8-
import sys
98
import codecs
9+
import ctypes
1010
from collections import OrderedDict
1111
import csv
1212
from datetime import datetime
@@ -1905,15 +1905,14 @@ def test_suppress_error_output(all_parsers, capsys):
19051905
assert captured.err == ""
19061906

19071907

1908-
def __should_skip_utf8_test():
1908+
def __windows_ansi_encoding_not_cp1252():
19091909
if compat.is_platform_windows():
1910-
import ctypes
19111910
ansi_codepage = ctypes.cdll.kernel32.GetACP()
1912-
return ansi_codepage != 1252 and sys.version_info < (3, 6)
1911+
return ansi_codepage != 1252 and not compat.PY36
19131912
return False
19141913

1915-
@pytest.mark.skipif(__should_skip_utf8_test(),
1916-
reason="Python < 3.6 won't pass on non-1252 codepage")
1914+
@pytest.mark.skipif(__windows_ansi_encoding_not_cp1252(),
1915+
reason="On Python < 3.6 won't pass on non-1252 codepage")
19171916
def test_filename_with_special_chars(all_parsers):
19181917
# see gh-15086.
19191918
parser = all_parsers

0 commit comments

Comments
 (0)