bpo-34226: fix cgi.parse_multipart without content_length#8530
Conversation
Lib/cgi.py
Outdated
There was a problem hiding this comment.
Please, simplify this to:
if 0 <= self.limit <= _read
6275f1a to
1e085da
Compare
|
Thanks a lot for this PR! Here are my two cents:
|
|
This looks good - we just need a NEWS entry. Click on "Details" next to the failed check for info on how to install and use blurb. (The title of this PR - properly captialised - will be a fine entry, and it can go in the "Library" category.) |
|
Should I backport to python 3.7? |
|
Normally backporting will be carried out automatically by nice bots after the PR for master is merged :)
(From https://devguide.python.org/committing/#backporting-changes-to-an-older-version) |
There was a problem hiding this comment.
Use formatting for cgi.parse_multipart:
cgi.parse_multipart -> cgi.parse_multipart.
Also, add "Patch by Roger Duran" at the end.
7243923 to
bd4f196
Compare
Lib/test/test_cgi.py
Outdated
There was a problem hiding this comment.
Hi, here's a typo => test_parse_multipart_without_content_legth should be test_parse_multipart_without_content_length (missing "n")
bd4f196 to
68e9502
Compare
|
@pablogsal @zooba Is there anything to do for this PR? As per PEP 537:
I guess 3.7.1 is coming soon. I hope this PR can get merged before that. |
|
The updated PEP 537 states that 3.7.1rc1 is coming the next week
Can this patch be reviewed and merged before that? |
|
Hi, just notice that this patch it's not yet merged, is there any change to be done? |
|
If you are waiting this PR as me, temporary solution |
|
Hey, this patch is still not merged. What is missing? (This is preventing me from upgrading an app to 3.7.) Also, the workaround |
Also add a reference to python/cpython#8530
Also add a reference to python/cpython#8530
|
@Roger Could you please resolve conflicts? |
In Python 3.7 the behavior of parse_multipart changed requiring CONTENT-LENGTH header, this fix remove this header as required and fix FieldStorage read_lines_to_outerboundary, by not using limit when it's negative, since by default it's -1 if not content-length and keeps substracting what was read from the file object. Also added a test case for this problem.
sure |
68e9502 to
1330f8c
Compare
|
I like this change. It looks like in #991 while concentrating on encoding, I missed to notice that the variable being looked for was This change will address that regression introduced in 3.7. I will merge this and set the label to backport to 3.7
|
|
Thanks @Roger for the PR 🌮🎉.. I'm working now to backport this PR to: 3.7, 3.8, 3.9. |
|
GH-20890 is a backport of this pull request to the 3.9 branch. |
) In Python 3.7 the behavior of parse_multipart changed requiring CONTENT-LENGTH header, this fix remove this header as required and fix FieldStorage read_lines_to_outerboundary, by not using limit when it's negative, since by default it's -1 if not content-length and keeps substracting what was read from the file object. Also added a test case for this problem. (cherry picked from commit d8cf351) Co-authored-by: roger <rogerduran@gmail.com>
|
GH-20891 is a backport of this pull request to the 3.8 branch. |
) In Python 3.7 the behavior of parse_multipart changed requiring CONTENT-LENGTH header, this fix remove this header as required and fix FieldStorage read_lines_to_outerboundary, by not using limit when it's negative, since by default it's -1 if not content-length and keeps substracting what was read from the file object. Also added a test case for this problem. (cherry picked from commit d8cf351) Co-authored-by: roger <rogerduran@gmail.com>
|
GH-20892 is a backport of this pull request to the 3.7 branch. |
) In Python 3.7 the behavior of parse_multipart changed requiring CONTENT-LENGTH header, this fix remove this header as required and fix FieldStorage read_lines_to_outerboundary, by not using limit when it's negative, since by default it's -1 if not content-length and keeps substracting what was read from the file object. Also added a test case for this problem. (cherry picked from commit d8cf351) Co-authored-by: roger <rogerduran@gmail.com>
) (GH-20892) In Python 3.7 the behavior of parse_multipart changed requiring CONTENT-LENGTH header, this fix remove this header as required and fix FieldStorage read_lines_to_outerboundary, by not using limit when it's negative, since by default it's -1 if not content-length and keeps substracting what was read from the file object. Also added a test case for this problem. (cherry picked from commit d8cf351) Co-authored-by: roger <rogerduran@gmail.com> Automerge-Triggered-By: @ned-deily
In Python 3.7 the behavior of parse_multipart changed requiring CONTENT-LENGTH header, this fix remove this header as required and fix FieldStorage read_lines_to_outerboundary, by not using limit when it's negative, since by default it's -1 if not content-length and keeps substracting what was read from the file object. Also added a test case for this problem. (cherry picked from commit d8cf351) Co-authored-by: roger <rogerduran@gmail.com>
In Python 3.7 the behavior of parse_multipart changed requiring CONTENT-LENGTH header, this fix remove this header as required and fix FieldStorage read_lines_to_outerboundary, by not using limit when it's negative, since by default it's -1 if not content-length and keeps substracting what was read from the file object. Also added a test case for this problem. (cherry picked from commit d8cf351) Co-authored-by: roger <rogerduran@gmail.com>
In Python 3.7 the behavior of parse_multipart changed requiring CONTENT-LENGTH
header, this fix remove this header as required and fix FieldStorage
read_lines_to_outerboundary, by not using limit when it's negative,
since by default it's -1 if not content-length and keeps substracting what
was read from the file object.
Also added a test case for this problem.
https://bugs.python.org/issue34226
Automerge-Triggered-By: @orsenthil