[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 
<http://bugs.python.org/issue23840>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 support.run_unittest(TestTokenizerAdheresToPep0263)
1231 support.run_unittest(Test_Tokenize)
1232 support.run_unittest(TestDetectEncoding)
1233 support.run_unittest(TestTokenize)
1234 support.run_unittest(UntokenizeTest)

--

___
Python tracker 
<http://bugs.python.org/issue23840>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 
<http://bugs.python.org/issue23840>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 
<http://bugs.python.org/issue23840>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 
<http://bugs.python.org/issue23840>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 
<http://bugs.python.org/issue23840>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com