Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(274530)

#22831: Use "with" to avoid possible fd leaks

Can't Edit
Can't Publish+Mail
Start Review
Created:
4 years, 9 months ago by storchaka+cpython
Modified:
3 years, 7 months ago
Reviewers:
vadmium+py
CC:
rhettinger, haypo, ezio.melotti, eric.araujo, Arfrever, devnull_psf.upfronthosting.co.za, berkerpeksag, Martin Panter, storchaka, dstufft
Visibility:
Public.

Patch Set 1 #

Total comments: 12

Patch Set 2 #

Patch Set 3 #

Patch Set 4 #

Patch Set 5 #

Patch Set 6 #

Patch Set 7 #

Patch Set 8 #

Patch Set 9 #

Total comments: 1

Patch Set 10 #

Total comments: 1

Patch Set 11 #

Unified diffs Side-by-side diffs Delta from patch set Stats Patch
Lib/test/support/__init__.py View 1 2 3 4 5 6 7 8 9 10 2 chunks +7 lines, -7 lines 0 comments Download
Lib/test/support/script_helper.py View 1 2 3 4 5 6 7 8 9 10 2 chunks +23 lines, -28 lines 0 comments Download
Lib/test/test_argparse.py View 1 2 3 4 5 6 7 8 9 10 4 chunks +8 lines, -12 lines 0 comments Download
Lib/test/test_binhex.py View 1 2 3 4 5 6 7 8 9 10 1 chunk +4 lines, -6 lines 0 comments Download
Lib/test/test_bool.py View 1 2 3 4 5 6 7 8 9 10 2 chunks +6 lines, -9 lines 0 comments Download
Lib/test/test_codecs.py View 1 2 3 4 5 6 7 8 9 10 1 chunk +2 lines, -3 lines 0 comments Download
Lib/test/test_curses.py View 1 2 3 4 5 6 7 8 9 10 1 chunk +4 lines, -5 lines 0 comments Download
Lib/test/test_epoll.py View 1 2 3 4 5 6 7 8 9 10 1 chunk +8 lines, -9 lines 0 comments Download
Lib/test/test_float.py View 1 2 3 4 5 6 7 8 9 10 1 chunk +8 lines, -9 lines 0 comments Download
Lib/test/test_ioctl.py View 1 2 3 4 5 6 7 8 9 10 1 chunk +3 lines, -3 lines 0 comments Download
Lib/test/test_os.py View 1 2 3 4 5 6 7 8 9 10 1 chunk +2 lines, -3 lines 0 comments Download
Lib/test/test_pipes.py View 1 2 3 4 5 6 7 8 9 10 1 chunk +2 lines, -3 lines 0 comments Download
Lib/test/test_pkg.py View 1 2 3 4 5 6 7 8 9 10 1 chunk +4 lines, -5 lines 0 comments Download
Lib/test/test_platform.py View 1 2 3 4 5 6 7 8 9 10 1 chunk +6 lines, -7 lines 0 comments Download
Lib/test/test_poll.py View 1 2 3 4 5 6 7 8 9 10 1 chunk +6 lines, -7 lines 0 comments Download
Lib/test/test_random.py View 1 2 3 4 5 6 7 8 9 10 1 chunk +2 lines, -3 lines 0 comments Download
Lib/test/test_runpy.py View 1 2 3 4 5 6 7 8 9 10 1 chunk +2 lines, -3 lines 0 comments Download
Lib/test/test_select.py View 1 2 3 4 5 6 7 8 9 10 1 chunk +15 lines, -16 lines 0 comments Download
Lib/test/test_shelve.py View 1 2 3 4 5 6 7 8 9 10 3 chunks +20 lines, -25 lines 0 comments Download
Lib/test/test_site.py View 1 2 3 4 5 6 7 8 9 10 1 chunk +3 lines, -4 lines 0 comments Download
Lib/test/test_socketserver.py View 1 2 3 4 5 6 7 8 9 10 1 chunk +15 lines, -17 lines 0 comments Download
Lib/test/test_ssl.py View 1 2 3 4 5 6 7 8 9 10 1 chunk +4 lines, -5 lines 0 comments Download
Lib/test/test_tempfile.py View 1 2 3 4 5 6 7 8 9 10 2 chunks +4 lines, -6 lines 0 comments Download
Lib/test/test_threading.py View 1 2 3 4 5 6 7 8 9 10 1 chunk +5 lines, -7 lines 0 comments Download
Lib/test/test_urllib2_localnet.py View 1 2 3 4 5 6 7 8 9 10 3 chunks +12 lines, -16 lines 0 comments Download
Lib/test/test_urllib2.py View 1 2 3 4 5 6 7 8 9 10 1 chunk +2 lines, -4 lines 0 comments Download
Lib/test/test_xmlrpc.py View 1 2 3 4 5 6 7 8 9 10 2 chunks +5 lines, -7 lines 0 comments Download
Lib/test/test_zipimport.py View 1 2 3 4 5 6 7 8 9 10 1 chunk +6 lines, -9 lines 0 comments Download
Lib/test/test_zipimport_support.py View 1 2 3 4 5 6 7 8 9 10 1 chunk +6 lines, -8 lines 0 comments Download

Messages

Total messages: 3
Martin Panter
https://bugs.python.org/review/22831/diff/14268/Lib/test/test_tarfile.py File Lib/test/test_tarfile.py (right): https://bugs.python.org/review/22831/diff/14268/Lib/test/test_tarfile.py#newcode1221 Lib/test/test_tarfile.py:1221: with tarfile.open(temparchive,'r') as tar: I think this new version ...
4 years, 5 months ago #1
storchaka_gmail.com
http://bugs.python.org/review/22831/diff/14268/Lib/test/test_tarfile.py File Lib/test/test_tarfile.py (right): http://bugs.python.org/review/22831/diff/14268/Lib/test/test_tarfile.py#newcode1221 Lib/test/test_tarfile.py:1221: with tarfile.open(temparchive,'r') as tar: On 2015/03/20 12:58:43, vadmium wrote: ...
4 years, 5 months ago #2
Martin Panter
3 years, 7 months ago #3
https://bugs.python.org/review/22831/diff/14280/Tools/scripts/fixheader.py
File Tools/scripts/fixheader.py (right):

https://bugs.python.org/review/22831/diff/14280/Tools/scripts/fixheader.py#ne...
Tools/scripts/fixheader.py:34: with f:
Should be moved up to just after the try / except block

https://bugs.python.org/review/22831/diff/14281/Tools/demo/markov.py
File Tools/demo/markov.py (right):

https://bugs.python.org/review/22831/diff/14281/Tools/demo/markov.py#newcode82
Tools/demo/markov.py:82: with f:
Could be moved up one line
Sign in to reply to this message.

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+