[Python-bugs-list] [ python-Bugs-467430 ] CGIHTTPServer (original) (raw)
noreply@sourceforge.net noreply@sourceforge.net
Tue, 16 Oct 2001 23:47:12 -0700
- Previous message: [Python-bugs-list] [ python-Bugs-471928 ] global made w/nested list comprehensions
- Next message: [Python-bugs-list] [ python-Bugs-417796 ] illegal version 1.0.2pre
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Bugs item #467430, was opened at 2001-10-03 01:09 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=467430&group_id=5470
Category: Python Library Group: Python 2.1.1
Status: Closed Resolution: Fixed Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Guido van Rossum (gvanrossum) Summary: CGIHTTPServer - 2 issues and/or bugs
Initial Comment:
- First, the easy one. I believe the following self.error_message calls should be replaced with self.log_message calls ... since no error actually has occured.
*** /opt/arseed/tfs-lib/lib/python2.1/CGIHTTPServer.py Tue Oct 2 20:35:04 2001 --- /home/norton/CGIHTTPServer.py Wed Oct 3 17:07:05 2001
*** 227,233 **** cmdline = "%s %s" % (interp, cmdline) if '=' not in query and '"' not in query: cmdline = '%s "%s"' % (cmdline, query) ! self.log_error("command: %s", cmdline) try: nbytes = int(length) except: --- 227,233 ---- cmdline = "%s %s" % (interp, cmdline) if '=' not in query and '"' not in query: cmdline = '%s "%s"' % (cmdline, query) ! self.log_message("command: %s", cmdline) try: nbytes = int(length) except:
*** 242,248 **** if sts: self.log_error("CGI script exit status %#x", sts) else: ! self.log_error("CGI script exited OK")
else:
# Other O.S. -- execute script in thisprocess --- 242,248 ---- if sts: self.log_error("CGI script exit status %#x", sts) else: ! self.log_message("CGI script exited OK")
else:
# Other O.S. -- execute script in thisprocess
*** 267,273 **** except SystemExit, sts: self.log_error("CGI script exit status %s", str(sts)) else: ! self.log_error("CGI script exited OK")
nobody = None --- 267,273 ---- except SystemExit, sts: self.log_error("CGI script exit status %s", str(sts)) else: ! self.log_message("CGI script exited OK")
nobody = None
- Secondly, I have created my own CGIHTTP handler class that re-uses the CGHITTPServer CGIHTTPRequestHandler class. I have modified Zope's ZPublisher.Client code to redirect file:// urls to this CGIHTTP handler so that external cgi executables can be proxied by zope. I have attached my handler to this request (only if you are curious).
Anyway, I feel the following patch should be applied to the standard python lib. I faced troubles with os.fork, os.dup2, and reading from self.rfile in the child process if the self.rfile is not flushed as well prior to forking.
*** Python-2.1.1/Lib/CGIHTTPServer.py Sat Sep 29 15:52:51 2001 --- Python-2.1.1/Lib/CGIHTTPServer.py Tue Oct 2 19:55:14 2001
*** 192,197 **** --- 192,198 ---- if '=' not in decoded_query: args.append(decoded_query) nobody = nobody_uid()
self.rfile.flush() # Always flush before
forking self.wfile.flush() # Always flush before forking pid = os.fork() if pid != 0:
Comment By: Guido van Rossum (gvanrossum) Date: 2001-10-16 23:47
Message: Logged In: YES user_id=6380
Thanks! Applied as rev 1.19.
You need an SF account and log in to upload attachments. Also, next time please upload the patches as attachments instead of inlining them.
Comment By: Nobody/Anonymous (nobody) Date: 2001-10-03 01:13
Message: Logged In: NO
The experimental handler attachment that I mentioned in the above message was rejected while adding the bug posting. If you would like to look at the code, please contact me (norton@alum.mit.edu) directly.
thanks,
- joe n.
You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=105470&aid=467430&group_id=5470
- Previous message: [Python-bugs-list] [ python-Bugs-471928 ] global made w/nested list comprehensions
- Next message: [Python-bugs-list] [ python-Bugs-417796 ] illegal version 1.0.2pre
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]