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

#20289: Make cgi.FieldStorage a context manager

Can't Edit
Can't Publish+Mail
Start Review
Created:
5 years, 5 months ago by brett
Modified:
4 years, 5 months ago
Reviewers:
storchaka, berker.peksag
CC:
brett.cannon, devnull_psf.upfronthosting.co.za, berkerpeksag, storchaka
Visibility:
Public.

Patch Set 1 #

Total comments: 9

Patch Set 2 #

Unified diffs Side-by-side diffs Delta from patch set Stats Patch
Doc/library/cgi.rst View 1 2 chunks +7 lines, -0 lines 0 comments Download
Doc/whatsnew/3.5.rst View 1 1 chunk +6 lines, -0 lines 0 comments Download
Lib/cgi.py View 1 1 chunk +6 lines, -0 lines 0 comments Download
Lib/test/test_cgi.py View 1 3 chunks +13 lines, -6 lines 0 comments Download

Messages

Total messages: 3
storchaka_gmail.com
http://bugs.python.org/review/20289/diff/10657/Lib/cgi.py File Lib/cgi.py (right): http://bugs.python.org/review/20289/diff/10657/Lib/cgi.py#newcode573 Lib/cgi.py:573: try: Why try/except is needed here? http://bugs.python.org/review/20289/diff/10657/Lib/test/test_cgi.py File Lib/test/test_cgi.py ...
4 years, 8 months ago #1
berkerpeksag
http://bugs.python.org/review/20289/diff/10657/Lib/cgi.py File Lib/cgi.py (right): http://bugs.python.org/review/20289/diff/10657/Lib/cgi.py#newcode573 Lib/cgi.py:573: try: On 2014/11/06 14:00:13, storchaka wrote: > Why try/except ...
4 years, 8 months ago #2
berkerpeksag
4 years, 5 months ago #3
http://bugs.python.org/review/20289/diff/10657/Lib/cgi.py
File Lib/cgi.py (right):

http://bugs.python.org/review/20289/diff/10657/Lib/cgi.py#newcode573
Lib/cgi.py:573: try:
On 2014/11/06 14:00:13, storchaka wrote:
> Why try/except is needed here?

Done.

http://bugs.python.org/review/20289/diff/10657/Lib/test/test_cgi.py
File Lib/test/test_cgi.py (right):

http://bugs.python.org/review/20289/diff/10657/Lib/test/test_cgi.py#newcode311
Lib/test/test_cgi.py:311: f = tempfile.NamedTemporaryFile("wb+")
On 2014/11/06 14:00:13, storchaka wrote:
> Could BytesIO be used instead of NamedTemporaryFile?

Done.

http://bugs.python.org/review/20289/diff/10657/Lib/test/test_cgi.py#newcode321
Lib/test/test_cgi.py:321: self.assertTrue(fs.file.closed)
On 2014/11/06 14:00:13, storchaka wrote:
> I think this check can be moved up, right below first "with". And add
> self.assertFalse(fs.file.closed) inside the "with" block.

Done.

http://bugs.python.org/review/20289/diff/10657/Lib/test/test_cgi.py#newcode322
Lib/test/test_cgi.py:322: f.close()
On 2014/11/06 14:00:13, storchaka wrote:
> This is redundant.

Done.
Sign in to reply to this message.

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