bpo-8077 Fix CGI Handling of POST on Windows.#25652
bpo-8077 Fix CGI Handling of POST on Windows.#25652orsenthil wants to merge 2 commits intopython:mainfrom orsenthil:issue8077
Conversation
| data = self.rfile.read(nbytes) | ||
| if len(data) < nbytes: | ||
| import tempfile | ||
| rfile = tempfile.TemporaryFile("wb+") |
There was a problem hiding this comment.
Rather than an actual file, could we use BytesIO or (at worst), mmap here instead?
There was a problem hiding this comment.
Good idea. All we care about is reading from socket and temporarily storing to a different file like object (which can support large files). I will try with BytesIO.
| data = None | ||
| rfile = None | ||
|
|
||
| if self.command.lower() == "post" and nbytes > 0: |
There was a problem hiding this comment.
I don't have windows, so I didn't test even the existing code in Windows. I believe that even the existing code is not going to work on windows due the condition nbytes > 0
nbytes is from Content-Length and I see that https://bugs.python.org/issue24764 Content-Length for multi-part form data was removed.
When I tried to add test, I could not exercise this.
- Before any change is done, a test case and testing under Windows is required for this Bugfix and Patch.
|
This PR is stale because it has been open for 30 days with no activity. |
|
Closing as cgi is deprecated as per pep 594 https://peps.python.org/pep-0594/#cgi |
bpo-8077: https://bugs.python.org/issue8077 - Fix CGI Handling of POST on Windows
The first version of patch was submitted by Pierre Quentel.
https://bugs.python.org/issue8077