This issue tracker has been migrated to GitHub ,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
Created on 2014年06月10日 11:57 by smurfix, last changed 2022年04月11日 14:58 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| cgi.patch2 | smurfix, 2014年06月10日 11:57 | |||
| Messages (5) | |||
|---|---|---|---|
| msg220164 - (view) | Author: Matthias Urlichs (smurfix) * | Date: 2014年06月10日 11:57 | |
This code in cgi.py makes no sense whatsoever: 842 if line.endswith(b"--") and last_line_lfend: 843 strippedline = line.strip() 844 if strippedline == next_boundary: 845 break 846 if strippedline == last_boundary: 847 self.done = 1 848 break (Pdb) p next_boundary b'--testdata' (Pdb) p last_boundary b'--testdata--' (Pdb) The net effect of this is that parsing a multipart with more than one file in it is impossible, as the first file's reader will gobble up the remainder of the input. Patch attached. I guess it's a safe bet that no sane person even uses cgi.py any more, otherwise this would have been discovered a bit sooner. |
|||
| msg352246 - (view) | Author: Pierre Quentel (quentel) * | Date: 2019年09月13日 08:32 | |
The patch has been applied some time ago (I couldn't find the exact commit), cf. https://github.com/python/cpython/blob/master/Lib/cgi.py#L750 I think we can close the issue. |
|||
| msg352568 - (view) | Author: Ethan Furman (ethan.furman) * (Python committer) | Date: 2019年09月16日 18:49 | |
The last status was "test-needed" -- has anyone verified that a test exists for this scenario? |
|||
| msg353146 - (view) | Author: Pierre Quentel (quentel) * | Date: 2019年09月25日 06:30 | |
@ethan.furman Yes, in test_cgi.py, the method test_fieldstorage_multipart_w3c https://github.com/python/cpython/blob/master/Lib/test/test_cgi.py#L316) uses a multipart content with 2 files in it (https://github.com/python/cpython/blob/master/Lib/test/test_cgi.py#L579) |
|||
| msg353221 - (view) | Author: Ethan Furman (ethan.furman) * (Python committer) | Date: 2019年09月25日 16:25 | |
Excellent, thanks for checking! |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:58:04 | admin | set | github: 65904 |
| 2020年07月20日 20:52:15 | Rhodri James | set | nosy:
- Rhodri James |
| 2019年09月25日 16:25:11 | ethan.furman | set | messages: + msg353221 |
| 2019年09月25日 06:30:27 | quentel | set | messages: + msg353146 |
| 2019年09月16日 18:49:06 | ethan.furman | set | messages: + msg352568 |
| 2019年09月14日 09:01:05 | corona10 | set | status: open -> closed resolution: fixed stage: test needed -> resolved |
| 2019年09月13日 08:32:46 | quentel | set | nosy:
+ quentel messages: + msg352246 |
| 2019年08月03日 14:59:28 | Rhodri James | set | nosy:
+ ethan.furman, Rhodri James |
| 2014年06月10日 13:47:09 | r.david.murray | set | nosy:
+ r.david.murray stage: test needed |
| 2014年06月10日 11:57:04 | smurfix | create | |