-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: unclosed file warning when passing invalid encoding #30034
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
Pretty interesting - is there something on bpo for this? |
should we consider replacing all uses of codecs. used in a few other places? |
seems the windows builds failed with this change for some reason. |
Just opened https://bugs.python.org/issue38971
Maybe? I'd want to track down why we're using codecs.open in the first place (best guess is a py2/py3 compat legacy)
Yah, looks like we're getting '\n' instead of '\r\n' somewhere along the way. Shouldn't be too hard to troubleshoot. |
windows problem was fixed by passing |
thanks |
This isn't directly related to #30031 but might solve it if the problem there is unclosed files piling up.
TL;DR: the actual problem is in the stdlib
codecs.open
:When we pass a bogus encoding "foo" in test_format, the
lookup
call raises, and leaves behind the file opened a few lines earlier.