changeset 4344:85b00a3820b3

Fix thread safety with stdin in roundup-server
author Richard Jones <richard@users.sourceforge.net>
date Tue, 02 Feb 2010 05:00:42 +0000
parents 7a0fe3cff4de
children 38265325492a
files CHANGES.txt doc/acknowledgements.txt roundup/cgi/client.py roundup/scripts/roundup_server.py
diffstat 4 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/CHANGES.txt	Tue Feb 02 04:59:20 2010 +0000
+++ b/CHANGES.txt	Tue Feb 02 05:00:42 2010 +0000
@@ -29,6 +29,8 @@
   issue2550632
 - Allow value to be specified to multilink form element templating, fixes
   issue2550613, thanks David Wolever
+- Fix thread safety with stdin in roundup-server, fixes issue2550596
+  (thanks Werner Hunger)
 
 
 2009-12-21 1.4.11 (r4413)
--- a/doc/acknowledgements.txt	Tue Feb 02 04:59:20 2010 +0000
+++ b/doc/acknowledgements.txt	Tue Feb 02 05:00:42 2010 +0000
@@ -58,6 +58,7 @@
 Uwe Hoffmann,
 Alex Holkner,
 Tobias Hunger,
+Werner Hunger,
 Simon Hyde,
 Paul Jimenez,
 Christophe Kalt,
--- a/roundup/cgi/client.py	Tue Feb 02 04:59:20 2010 +0000
+++ b/roundup/cgi/client.py	Tue Feb 02 05:00:42 2010 +0000
@@ -300,7 +300,7 @@
 
         # see if we need to re-parse the environment for the form (eg Zope)
         if form is None:
-            self.form = cgi.FieldStorage(environ=env)
+            self.form = cgi.FieldStorage(fp=request.rfile, environ=env)
         else:
             self.form = form
 
--- a/roundup/scripts/roundup_server.py	Tue Feb 02 04:59:20 2010 +0000
+++ b/roundup/scripts/roundup_server.py	Tue Feb 02 05:00:42 2010 +0000
@@ -188,8 +188,6 @@
         """ Execute the CGI command. Wrap an innner call in an error
             handler so all errors can be caught.
         """
-        save_stdin = sys.stdin
-        sys.stdin = self.rfile
         try:
             self.inner_run_cgi()
         except client.NotFound:
@@ -226,7 +224,6 @@
                     # out to the logfile
                     print 'EXCEPTION AT', ts
                     traceback.print_exc()
-        sys.stdin = save_stdin
 
     do_GET = do_POST = do_HEAD = run_cgi
 

Roundup Issue Tracker: http://roundup-tracker.org/