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

#20504: cgi.FieldStorage, multipart, missing Content-Length

Can't Edit
Can't Publish+Mail
Start Review
Created:
3 years, 11 months ago by srittau
Modified:
3 years, 11 months ago
Reviewers:
victor.stinner
CC:
srittau, haypo, Benjamin Peterson, ned.deily, smurf_smurf.noris.de, pierre.quentel_gmail.com, berkerpeksag, paul.goins_canonical.com, mariatta.wijaya+miss-islington_gmail.com
Visibility:
Public.

Patch Set 1 #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats Patch
Lib/cgi.py View 3 chunks +5 lines, -4 lines 2 comments Download
Lib/test/test_cgi.py View 1 chunk +16 lines, -0 lines 1 comment Download

Messages

Total messages: 1
victor.stinner_gmail.com
3 years, 11 months ago #1
http://bugs.python.org/review/20504/diff/15802/Lib/cgi.py
File Lib/cgi.py (right):

http://bugs.python.org/review/20504/diff/15802/Lib/cgi.py#newcode440
Lib/cgi.py:440: read
You must update this documentation, you have to explain that limit can be None.
The limit is None if there is no Content-Length header, if the Content-Length
header is invalid decimal integer, or if the Content-Length header is a smaller
than 1.

http://bugs.python.org/review/20504/diff/15802/Lib/cgi.py#newcode728
Lib/cgi.py:728: limit = (self.limit - self.bytes_read
I prefer classic if rather than ternary form, for readability.

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

http://bugs.python.org/review/20504/diff/15802/Lib/test/test_cgi.py#newcode265
Lib/test/test_cgi.py:265: self.assertEqual(len(fs['my-arg'].file.read()), 5)
I would prefer to check the content rather than just the content length.
Sign in to reply to this message.

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