Re: cgi.FieldStorage() not work for python requests.post but work for requests.get

2017-05-07 Thread 程淼
t; > print e > > else: > > print req > > print req.headers > > print req.text > > -- > > arguments always get FieldStorage(None, None, []) > > > > > > and i us

cgi.FieldStorage() not work for python requests.post but work for requests.get

2017-05-05 Thread 程淼
arguments always get FieldStorage(None, None, []) and i use other post way, it works. -- login http://abc.com:11/ip/"; method="post"> -- is this any problem requests.post(python) with cgi.FieldStorage ? Thanks -- https://mail.python.org/mailman/listinfo/python-list

Re: cgi.FieldStorage() not work for python requests.post but work for requests.get

2017-05-05 Thread 程淼
--- > arguments always get FieldStorage(None, None, []) > > > and i use other post way, it works. > -- > > login > > http://abc.com:11/ip/"; method="post"> > > > > > > > -- > > is this any problem requests.post(python) with cgi.FieldStorage ? > > > Thanks Server : Apache/2.4.10 (Debian) -- https://mail.python.org/mailman/listinfo/python-list

Re: cgi.fieldstorage()

2009-07-26 Thread Diez B. Roggisch
gert schrieb: On Jul 25, 2:33 am, "Diez B. Roggisch" wrote: gert schrieb: On Jul 24, 7:32 pm, "Diez B. Roggisch" wrote: gert schrieb: this is a non standard way to store multi part post data on disk def application(environ, response): with open('/usr/httpd/var/wsgiTemp','w') as f:

Re: cgi.fieldstorage()

2009-07-25 Thread gert
On Jul 25, 2:33 am, "Diez B. Roggisch" wrote: > gert schrieb: > > > On Jul 24, 7:32 pm, "Diez B. Roggisch" wrote: > >> gert schrieb: > > >>> this is a non standard way to store multi part post data on disk > >>> def application(environ, response): > >>>     with open('/usr/httpd/var/wsgiTemp','w'

Re: cgi.fieldstorage()

2009-07-24 Thread Diez B. Roggisch
gert schrieb: On Jul 24, 7:32 pm, "Diez B. Roggisch" wrote: gert schrieb: this is a non standard way to store multi part post data on disk def application(environ, response): with open('/usr/httpd/var/wsgiTemp','w') as f: while True: chunk = environ['wsgi.input'].read(

Re: cgi.fieldstorage()

2009-07-24 Thread gert
On Jul 24, 7:32 pm, "Diez B. Roggisch" wrote: > gert schrieb: > > > this is a non standard way to store multi part post data on disk > > > def application(environ, response): > >     with open('/usr/httpd/var/wsgiTemp','w') as f: > >         while True: > >             chunk = environ['wsgi.input'

Re: cgi.fieldstorage()

2009-07-24 Thread Diez B. Roggisch
gert schrieb: this is a non standard way to store multi part post data on disk def application(environ, response): with open('/usr/httpd/var/wsgiTemp','w') as f: while True: chunk = environ['wsgi.input'].read(8192).decode('latin1') if not chunk: break

cgi.fieldstorage()

2009-07-24 Thread gert
this is a non standard way to store multi part post data on disk def application(environ, response): with open('/usr/httpd/var/wsgiTemp','w') as f: while True: chunk = environ['wsgi.input'].read(8192).decode('latin1') if not chunk: break f.write(chun

cgi.FieldStorage hanging with Python 3.0 (but works with 2.5.1)

2009-01-13 Thread Andy Grove
pecific to the ActivePython distribution. Here is the relevant code: class MyHandler(http.server.BaseHTTPRequestHandler): def do_POST(self): try: print( "Calling cgi.FieldStorage()" ) form = cgi.FieldStorage( fp=self.rfile,

Re: cgi.FieldStorage() not working on Windows

2007-06-13 Thread arorap
work just like CGI. > > I wouldn't rely on it being exactly the same. The way it works uses a > number of kludges. Also, the mod_python.cgihandler code in mod_python > doesn't really get much attention from mod_python developers anymore > and not sure if it was even specifica

Re: cgi.FieldStorage() not working on Windows

2007-06-13 Thread Graham Dumpleton
ython developers anymore and not sure if it was even specifically retested when mod_python 3.3 was released. > Any clue why the > cgi.FieldStorage()might not be working ? Have no idea why it doesn't work as works as written on MacOS X even when mod_python.cgihandler is used. You&#x

Re: cgi.FieldStorage() not working on Windows

2007-06-12 Thread arorap
Thanks for your reply. The reason I want to run it as CGI (even though mod_php is available on my local computer) is that the target machine to which I will finally be uploading my scripts runs CGI. cgihandler should work just like CGI. Any clue why the cgi.FieldStorage()might not be working

Re: cgi.FieldStorage() not working on Windows

2007-06-12 Thread Graham Dumpleton
On Jun 13, 1:17 am, arorap <[EMAIL PROTECTED]> wrote: > I've mod_php installed with Apache 2.2. In one of my folders, I'm > using the cgihandler as the PythonHandler as my target host runs > python only as CGI. Here cgi.FieldStorage() doesn't seem to work. I > c

cgi.FieldStorage() not working on Windows

2007-06-12 Thread arorap
I've mod_php installed with Apache 2.2. In one of my folders, I'm using the cgihandler as the PythonHandler as my target host runs python only as CGI. Here cgi.FieldStorage() doesn't seem to work. I can see the form data in sys.stdin but cgi.FieldStorage() returns an empty diction

Re: brain cramp: emulating cgi.FieldStorage

2005-09-15 Thread Mike Meyer
"Chris Curvey" <[EMAIL PROTECTED]> writes: > I can't be the first person to want to do this, but I also can't seem > to find a solution. (Perhaps my Google skills are poor today.) How > can I emulate cgi.FieldStorage() for my unit tests so that I don'

Re: brain cramp: emulating cgi.FieldStorage

2005-09-15 Thread Chris Curvey
figured it out... os.environ["QUERY_STRING"] = "foo=bar" fs = cgi.FieldStorage() functionToBeTested(fs) -- http://mail.python.org/mailman/listinfo/python-list

Re: brain cramp: emulating cgi.FieldStorage

2005-09-15 Thread Max M
Chris Curvey wrote: > I can't be the first person to want to do this, but I also can't seem > to find a solution. (Perhaps my Google skills are poor today.) How > can I emulate cgi.FieldStorage() for my unit tests so that I don't have > to put a web server in the way?

brain cramp: emulating cgi.FieldStorage

2005-09-15 Thread Chris Curvey
I can't be the first person to want to do this, but I also can't seem to find a solution. (Perhaps my Google skills are poor today.) How can I emulate cgi.FieldStorage() for my unit tests so that I don't have to put a web server in the way? what I'd like to do i

Re: questions concerning cgi.FieldStorage(keep_blank_values=1)

2005-02-20 Thread Michele Simionato
Jonas: > in this application, i need keys to be delivered with the url, some with > and some without value (for example 'script.py?key1&key2=foo'. You are missing an "=" sign after key1. Confront with this example: from cgi import parse_qsl QS = "x=1&y=2&x=3&z=&y=4" print parse_qsl(QS) print par

Re: questions concerning cgi.FieldStorage(keep_blank_values=1)

2005-02-20 Thread Daniel Lichtenberger
Jonas Meurer wrote: "key1" isn't a valid parameter, to supply an empty key you would write script.py?key1=&key2=foo Then cgi.FieldStorage also includes key1. great, it works. but is there no way to use single keywords as GET argument? You could manually parse the request str

Re: questions concerning cgi.FieldStorage(keep_blank_values=1)

2005-02-20 Thread Jonas Meurer
On 20/02/2005 Daniel Lichtenberger wrote: > > any suggestions about how to make form.keys() contain the blank keys > > as well? > > "key1" isn't a valid parameter, to supply an empty key you would write > script.py?key1=&key2=foo > > Then cgi.Fie

Re: questions concerning cgi.FieldStorage(keep_blank_values=1)

2005-02-20 Thread Daniel Lichtenberger
o supply an empty key you would write script.py?key1=&key2=foo Then cgi.FieldStorage also includes key1. bye, Daniel -- For mail replies please use my address from http://perplex.schmumpf.de/ http://www.gametective.de/ -- http://mail.python.org/mailman/listinfo/python-list

questions concerning cgi.FieldStorage(keep_blank_values=1)

2005-02-20 Thread Jonas Meurer
ready figured out that i need to give non-empty keep_blank_values as argument to cgi.FieldStorage, to make it not cut all the empty keywords. anyway, this still doesn't work really good: ---snip--- form = cgi.FieldStorage(keep_blank_values=1) print 'list keys with form.keys():' ke