Skip to content

Commit 265d4cf

Browse files
committed
Merge pull request #5149 from jreback/sparc_fix3
TST: use default utf8 encoding when passing encoding to parser as Bytes (GH5141)
2 parents d73fa1a + 00815cb commit 265d4cf

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pandas/io/tests/test_parsers.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -2147,7 +2147,7 @@ def test_fwf_compression(self):
21472147
def test_BytesIO_input(self):
21482148
if not compat.PY3:
21492149
raise nose.SkipTest("Bytes-related test - only needs to work on Python 3")
2150-
result = pd.read_fwf(BytesIO("שלום\nשלום".encode('utf8')), widths=[2,2])
2150+
result = pd.read_fwf(BytesIO("שלום\nשלום".encode('utf8')), widths=[2,2], encoding='utf8')
21512151
expected = pd.DataFrame([["של", "ום"]], columns=["של", "ום"])
21522152
tm.assert_frame_equal(result, expected)
21532153
data = BytesIO("שלום::1234\n562::123".encode('cp1255'))
@@ -2319,9 +2319,9 @@ def test_variable_width_unicode(self):
23192319
של ום
23202320
'''.strip('\r\n')
23212321
expected = pd.read_fwf(BytesIO(test.encode('utf8')),
2322-
colspecs=[(0, 4), (5, 9)], header=None)
2322+
colspecs=[(0, 4), (5, 9)], header=None, encoding='utf8')
23232323
tm.assert_frame_equal(expected, read_fwf(BytesIO(test.encode('utf8')),
2324-
header=None))
2324+
header=None, encoding='utf8'))
23252325

23262326

23272327
class TestCParserHighMemory(ParserTests, unittest.TestCase):

0 commit comments

Comments
 (0)