[issue11577] testcase for exception binhex.Error

2011-03-17 Thread Nick Coghlan
Nick Coghlan added the comment: This is fixed on default as well, I just stuffed the merge so the history looks odd and the integration script didn't pick it up. You can see the additional changes I made in the linked changeset: - try/except with a flag to clean up implicitly created file obje

[issue11577] testcase for exception binhex.Error

2011-03-16 Thread Roundup Robot
Roundup Robot added the comment: New changeset 5c2d15c6007e by Nick Coghlan in branch '3.2': Close #11577: Improve binhex test coverage and fix ResourceWarning http://hg.python.org/cpython/rev/5c2d15c6007e -- nosy: +python-dev resolution: -> fixed stage: -> committed/rejected status:

[issue11577] testcase for exception binhex.Error

2011-03-16 Thread Arkady Koplyarov
Arkady Koplyarov added the comment: Well, I believe that in BinHex.__init__() I cannot just wrap the _writeinfo call into a try-finally block, and close ofp in the finally. I see that in the case of normal operation when the exception is not thrown, the output file descriptor ofp is used in b

[issue11577] testcase for exception binhex.Error

2011-03-16 Thread SilentGhost
SilentGhost added the comment: Arkady, I don't see why you need to catch exception. Just wrap the _writeinfo call into a try-finally block, and close ofp in the finally. -- nosy: +SilentGhost ___ Python tracker _

[issue11577] testcase for exception binhex.Error

2011-03-16 Thread Arkady Koplyarov
Arkady Koplyarov added the comment: The testcase provided shows up a resource leakage: - C:\_cpython\cpython>PCbuild\python_d.exe -m test.regrtest test_binhex [1/1] test_binhex C:\_cpython\cpython\lib\unittest\case.py:574: ResourceWarning: unclosed file <_io.BufferedWriter name='@test_5592

[issue11577] testcase for exception binhex.Error

2011-03-16 Thread Arkady Koplyarov
Arkady Koplyarov added the comment: The testcase updated accordingly to Nick Coghlan's suggestion to use assertRaises() since the testcase deals with an exception. -- Added file: http://bugs.python.org/file21252/testcase_for_binhex_module_2.patch __

[issue11577] testcase for exception binhex.Error

2011-03-16 Thread Nick Coghlan
Nick Coghlan added the comment: unittest provides a utility to help with testing that correct exceptions are raised: http://docs.python.org/dev/library/unittest#unittest.TestCase.assertRaises -- ___ Python tracker

[issue11577] testcase for exception binhex.Error

2011-03-16 Thread Nick Coghlan
Changes by Nick Coghlan : -- nosy: +ncoghlan ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python

[issue11577] testcase for exception binhex.Error

2011-03-16 Thread Brian Curtin
Changes by Brian Curtin : -- nosy: +brian.curtin ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.py

[issue11577] testcase for exception binhex.Error

2011-03-16 Thread Arkady Koplyarov
New submission from Arkady Koplyarov : Testcase for exception binhex.Error to increase test coverage. -- components: Library (Lib), Tests files: testcase_for_binhex_module.patch keywords: patch messages: 131159 nosy: arkady.koplyarov priority: normal severity: normal status: open title: