[issue8077] cgi handling of POSTed files is broken in Windows

2021-04-27 Thread Senthil Kumaran


Change by Senthil Kumaran :


--
pull_requests: +24343
stage: test needed -> patch review
pull_request: https://github.com/python/cpython/pull/25652

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8077] cgi handling of POSTed files is broken in Windows

2021-04-27 Thread Senthil Kumaran


Change by Senthil Kumaran :


--
title: cgi handling of POSTed files is broken -> cgi handling of POSTed files 
is broken in Windows
versions: +Python 3.10 -Python 3.2, Python 3.3

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8077] cgi handling of POSTed files is broken

2012-05-03 Thread Pierre Quentel

Pierre Quentel pierre.quen...@gmail.com added the comment:

There are 2 different problems :
- handling of data by cgi.FieldStorage (issue 4953) : fixed since version 3.2
- in http.server.CGIHTTPRequestHandler, for POST requests on Windows, before 
opening the subprocess in run_cgi() all data is read by a *single* call to 
self.rfile.read(). If not all bytes are read by this single call, which is the 
case for a large file upload, only the read data are processed

The attached patch modifies http.server :
- if all data are read in the first call to self.rfile.read() (that is, if its 
length is equal to the Content-length header), process them
- if not, store all data in a temporary file (not in memory) and set the stdin 
argument of subprocess.Popen to this temporary file

With this patch, the tests provided by Mitchell all work on my PC (Windows XP 
Pro SP3)

--
keywords: +patch
Added file: http://bugs.python.org/file25440/http-server.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8077
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8077] cgi handling of POSTed files is broken

2012-05-03 Thread Senthil Kumaran

Changes by Senthil Kumaran sent...@uthcode.com:


--
assignee:  - orsenthil
nosy: +orsenthil

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8077
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8077] cgi handling of POSTed files is broken

2012-05-02 Thread Pierre Quentel

Changes by Pierre Quentel pierre.quen...@gmail.com:


--
nosy: +quentel

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8077
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8077] cgi handling of POSTed files is broken

2012-02-24 Thread Ezio Melotti

Changes by Ezio Melotti ezio.melo...@gmail.com:


--
stage:  - test needed
versions: +Python 3.3 -Python 3.1

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8077
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8077] cgi handling of POSTed files is broken

2011-07-03 Thread STINNER Victor

Changes by STINNER Victor victor.stin...@haypocalc.com:


--
nosy: +haypo

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8077
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8077] cgi handling of POSTed files is broken

2010-09-15 Thread R. David Murray

Changes by R. David Murray rdmur...@bitdance.com:


--
nosy: +r.david.murray
title: urlparse - cgi handling of POSTed files is broken

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8077
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8077] cgi handling of POSTed files is broken

2010-07-29 Thread Georg Brandl

Changes by Georg Brandl ge...@python.org:


--
assignee: georg.brandl - 

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8077
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8077] cgi handling of POSTed files is broken

2010-06-16 Thread Guido van Rossum

Guido van Rossum gu...@python.org added the comment:

Could this be related to issue 4953?

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8077
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8077] cgi handling of POSTed files is broken

2010-06-09 Thread Guido van Rossum

Guido van Rossum gu...@python.org added the comment:

The example works for me if I make this change:

--- Lib/cgi.py  (revision 81862)
+++ Lib/cgi.py  (working copy)
@@ -608,7 +608,7 @@
 parser = email.parser.FeedParser()
 # Create bogus content-type header for proper multipart parsing
 parser.feed('Content-Type: %s; boundary=%s\r\n\r\n' % (self.type, ib))
-parser.feed(self.fp.read())
+parser.feed(self.fp.read(self.length))
 full_msg = parser.close()
 # Get subparts
 msgs = full_msg.get_payload()


However this seems iffy to me because the content length presumably counts 
bytes whereas self.fp seems to be a text file, but since most HTTP clients 
don't close the connection, without some kind of boundary on the read() call it 
just hangs forever.

Also someone pointed out to me offline that this change may be needed, 
separately (though I haven't confirmed this yet):

--- Lib/cgi.py  (revision 81862)
+++ Lib/cgi.py  (working copy)
@@ -233,6 +233,7 @@
 lines = []
 while 1:
 line = fp.readline()
+line = line.decode()
 if not line:
 terminator = lastpart # End outer loop
 break

--
components:  -Documentation
nosy: +gvanrossum

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8077
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8077] cgi handling of POSTed files is broken

2010-03-16 Thread Gabriel Genellina

Gabriel Genellina gagsl-...@yahoo.com.ar added the comment:

This doesn't look like a documentation bug to me - handling of uploaded files 
via CGI *should* work, even if CGI is not the best way to do that.

--
nosy: +gagenellina

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8077
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8077] cgi handling of POSTed files is broken

2010-03-05 Thread Mitchell Model

New submission from Mitchell Model m...@acm.org:

I am reluctant to post this because (a) I might have made some dumb mistake in 
my code, simple as it is, and (b) the problem might be well-known or even 
hopeless because the cgi module may not be WSGI compliant, but if this isn't 
going to be fixed then at least the problem should be described in the cgi 
module documentation.

I run an HTTPServer with a CGIHTTPRequestHandler.
I open an HTML file with a trivial form that simply POSTs an upload of a single 
file.
I browse, select a file, and click submit.
The web request never completes -- the browser just waits for a response.
Interrupting the server with ^C^C produces a backtrace that indicates it is 
stuck trying to decode the file contents.

The attached zip file contains:
cgi-server.py
cgi-post.html
cgi-bin/cgi-test.py
exception.txt
The latter is the backtrace output from when I interrupt the server.

This is on OS X 10.5 with either Python3.1 or Python3.2 from the repository.

--
assignee: georg.brandl
components: Documentation, Library (Lib)
files: cgi-post-broken.zip
messages: 100509
nosy: MLModel, georg.brandl
severity: normal
status: open
title: cgi handling of POSTed files is broken
type: behavior
versions: Python 3.1, Python 3.2
Added file: http://bugs.python.org/file16465/cgi-post-broken.zip

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8077
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com