Skip to content

Commit 961b8d4

Browse files
authored
TST: encoding for URLs in read_csv (#35742)
1 parent f97c2af commit 961b8d4

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

pandas/tests/io/parser/test_network.py

+15
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,21 @@ def check_compressed_urls(salaries_table, compression, extension, mode, engine):
4646
tm.assert_frame_equal(url_table, salaries_table)
4747

4848

49+
@tm.network("https://raw.githubusercontent.com/", check_before_test=True)
50+
def test_url_encoding_csv():
51+
"""
52+
read_csv should honor the requested encoding for URLs.
53+
54+
GH 10424
55+
"""
56+
path = (
57+
"https://raw.githubusercontent.com/pandas-dev/pandas/master/"
58+
+ "pandas/tests/io/parser/data/unicode_series.csv"
59+
)
60+
df = read_csv(path, encoding="latin-1", header=None)
61+
assert df.loc[15, 1] == "Á köldum klaka (Cold Fever) (1994)"
62+
63+
4964
@pytest.fixture
5065
def tips_df(datapath):
5166
"""DataFrame with the tips dataset."""

0 commit comments

Comments
 (0)