[issue23840] tokenize.open() leaks an open binary file on TextIOWrapper error

2015-04-24 Thread Matt Chung
Matt Chung added the comment: Hey Haypo, I'm working on submitting the new patch now. Still getting used to the workflow and tools here. Thanks for being patient. You should see the new file in the next 30 minutes. -- ___ Python tracker rep

[issue23840] tokenize.open() leaks an open binary file on TextIOWrapper error

2015-04-01 Thread Matt Chung
Matt Chung added the comment: Updated patch based off of haypo's comment. Changed except Exception as err: - except -- Added file: http://bugs.python.org/file38795/tokenize.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org

[issue23840] tokenize.open() leaks an open binary file on TextIOWrapper error

2015-04-01 Thread Matt Chung
Matt Chung added the comment: Based off of storchaka's comment, moving the -- Added file: http://bugs.python.org/file38799/tokenize.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23840

[issue23840] tokenize.open() leaks an open binary file on TextIOWrapper error

2015-04-01 Thread Matt Chung
Matt Chung added the comment: I believe it goes here under the TestTokenize class. Going to give it a shot now. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23840

[issue23840] tokenize.open() leaks an open binary file on TextIOWrapper error

2015-04-01 Thread Matt Chung
Matt Chung added the comment: Comparing to introom. Any reason to not wrap the entire in a try? Attached patch. -- nosy: +itsmemattchung Added file: http://bugs.python.org/file38793/issue23840.patch ___ Python tracker rep...@bugs.python.org http

[issue23840] tokenize.open() leaks an open binary file on TextIOWrapper error

2015-04-01 Thread Matt Chung
Matt Chung added the comment: Curious, @haypo, are you looking for a new unittest or a function within an existing unit test? Perhaps go under TestTokenize? 1227 def test_main(): 1228 from test import test_tokenize 1229 support.run_doctest(test_tokenize, True) 1230