-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: windows with TemporaryFile an read_csv #13398 #13481
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 10 commits
d8decae
5af8465
119fb65
98e476e
fd20aaf
d8ceb57
1c33fb5
aa3f0aa
5871625
0d54151
8b52631
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -171,3 +171,17 @@ def test_read_table_buglet_4x_multiindex(self): | |
columns=list('abcABC'), index=list('abc')) | ||
actual = self.read_table(StringIO(data), sep='\s+') | ||
tm.assert_frame_equal(actual, expected) | ||
|
||
def test_temporary_file(self): | ||
# GH13398 | ||
data1 = "0 0" | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why do we need to do this? What's wrong with There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nothing. It's late Sunday evening with a crappy game on tv :p There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Join the club! 😄 |
||
from tempfile import TemporaryFile | ||
new_file = TemporaryFile("w+") | ||
new_file.write(data1) | ||
new_file.flush() | ||
new_file.seek(0) | ||
|
||
result = self.read_csv(new_file, sep=r"\s+", header=None) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you double check that this actually errors without your changes? I couldn't get an error on my end (I think you need to change the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I have the error when I revert the change. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmm...how odd. It's because we do special handling of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. OK, I understand. I don't think it makes a difference as the test is not yet done there ont he regex, but I don't know the rest of pandas, so I trust you. I used @jreback regex, so using mine again in my last change. |
||
expected = DataFrame([[0, 0]]) | ||
tm.assert_frame_equal(result, expected) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there are some grammar issues in that sentence.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, changed