Skip to content

Commit cf2e062

Browse files
committed
Make sure test_filename_with_special_chars properly tests combinations of chars
Updated whatsnew
1 parent 762ca10 commit cf2e062

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

doc/source/whatsnew/v0.25.0.rst

+1
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ 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)
144145

145146
Categorical
146147
^^^^^^^^^^^

pandas/tests/io/parser/test_common.py

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

8+
import sys
89
import codecs
910
from collections import OrderedDict
1011
import csv
@@ -1903,13 +1904,21 @@ def test_suppress_error_output(all_parsers, capsys):
19031904
captured = capsys.readouterr()
19041905
assert captured.err == ""
19051906

1907+
def __should_skip_utf8_test():
1908+
if compat.is_platform_windows():
1909+
import ctypes
1910+
ansi_codepage = ctypes.cdll.kernel32.GetACP()
1911+
return ansi_codepage != 1252 and sys.version_info < (3, 6)
1912+
return False
19061913

1914+
@pytest.mark.skipif(__should_skip_utf8_test(),
1915+
reason="Python < 3.6 won't pass on non-1252 codepage")
19071916
def test_filename_with_special_chars(all_parsers):
19081917
# see gh-15086.
19091918
parser = all_parsers
19101919
df = DataFrame({"a": [1, 2, 3]})
19111920

1912-
with tm.ensure_clean("sé-es-vé.csv") as path:
1921+
with tm.ensure_clean("sé-es-vé-sй.csv") as path:
19131922
df.to_csv(path, index=False)
19141923

19151924
result = parser.read_csv(path)

0 commit comments

Comments
 (0)