Skip to content

Commit 1c33fb5

Browse files
committed
Simplified test and added what's new note.
1 parent d8ceb57 commit 1c33fb5

File tree

2 files changed

+5
-10
lines changed

2 files changed

+5
-10
lines changed

doc/source/whatsnew/v0.18.2.txt

+1
Original file line numberDiff line numberDiff line change
@@ -493,6 +493,7 @@ Bug Fixes
493493
- Bug in ``pd.read_csv()`` in which the ``nrows`` argument was not properly validated for both engines (:issue:`10476`)
494494
- Bug in ``pd.read_csv()`` with ``engine='python'`` in which infinities of mixed-case forms were not being interpreted properly (:issue:`13274`)
495495
- Bug in ``pd.read_csv()`` with ``engine='python'`` in which trailing ``NaN`` values were not being parsed (:issue:`13320`)
496+
- Bug in ``pd.read_csv()`` with ``engine='python'`` when reading from a tempfile.TemporaryFile on Windows with Python 3 a file with the separator expressed as a regex (:issue:`13398`)
496497
- Bug in ``pd.read_csv()`` that prevents ``usecols`` kwarg from accepting single-byte unicode strings (:issue:`13219`)
497498
- Bug in ``pd.read_csv()`` that prevents ``usecols`` from being an empty set (:issue:`13402`)
498499
- Bug in ``pd.read_csv()`` with ``engine=='c'`` in which null ``quotechar`` was not accepted even though ``quoting`` was specified as ``None`` (:issue:`13411`)

pandas/io/tests/parser/python_parser_only.py

+4-10
Original file line numberDiff line numberDiff line change
@@ -174,14 +174,7 @@ def test_read_table_buglet_4x_multiindex(self):
174174

175175
def test_temporary_file(self):
176176
# GH13398
177-
data1 = """index,A,B,C,D
178-
foo,2,3,4,5
179-
bar,7,8,9,10
180-
baz,12,13,14,15
181-
qux,12,13,14,15
182-
foo2,12,13,14,15
183-
bar2,12,13,14,15
184-
"""
177+
data1 = "0,0"
185178
data2 = data1.replace(",", " ")
186179

187180
from tempfile import TemporaryFile
@@ -190,6 +183,7 @@ def test_temporary_file(self):
190183
new_file.flush()
191184
new_file.seek(0)
192185

193-
result = self.read_csv(new_file, sep=r"\s+", engine="python")
194-
expected = self.read_csv(StringIO(data1))
186+
result = self.read_csv(new_file, sep=r"\s+", header=None)
187+
expected = DataFrame([[0, 0]])
195188
tm.assert_frame_equal(result, expected)
189+

0 commit comments

Comments
 (0)