-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: read_csv does not close file during an error in _make_reader #39029
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
Conversation
Hello @twoertwein! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found: There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻 Comment last updated at 2021-01-13 15:25:47 UTC |
are the problems only on windows? one of the exception messages suggested that the file was being held by another process, maybe something is being spawned in windows that isnt spawned in non-windows? come to think of it, when the tests are run with multiple processes, i dont think check_file_leaks would count files opened by sub-processes. |
the original issue only happens on windows:
This PR uses a different exception for (1) and instead of (2) my idea was to simply check for opened files (should also fail on linux). |
@jreback ping |
thanks @twoertwein |
Owee, I'm MrMeeseeks, Look at me. There seem to be a conflict, please backport manually. Here are approximate instructions:
And apply the correct labels and milestones. Congratulation you did some good work ! Hopefully your backport PR will be tested by the continuous integration and merged soon! If these instruction are inaccurate, feel free to suggest an improvement. |
@meeseeksdev backport 1.2.x |
Owee, I'm MrMeeseeks, Look at me. There seem to be a conflict, please backport manually. Here are approximate instructions:
And apply the correct labels and milestones. Congratulation you did some good work ! Hopefully your backport PR will be tested by the continuous integration and merged soon! If these instruction are inaccurate, feel free to suggest an improvement. |
cc @twoertwein if you wouldn't mind putting up a backport PR for this |
… in _make_reader (#39160)
I don't understand why
td.check_file_leaks
doesn't complain about the left opened file (at least for me locally). I commented the close call on purpose to see whether the test fails at least for the CI.@jbrockmendel I think you have debugged ResourceWarnings in the past. Do you know why the test doesn't fail? Even putting a
open("foo", mode="w")
in the test doesn't make it fail.[The test case is different from #39024 but the symptoms are the same. Unless the except clause is narrowed down to specific exceptions, this PR will fix #39024]