From 278afda38aaee1719f4fe422579d7e30d8cd7d01 Mon Sep 17 00:00:00 2001 From: richard Date: Tue, 2 Feb 2010 05:00:42 +0000 Subject: [PATCH] Fix thread safety with stdin in roundup-server git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/roundup/trunk@4448 57a73879-2fb5-44c3-a270-3262357dd7e2 --- CHANGES.txt | 2 ++ doc/acknowledgements.txt | 1 + roundup/cgi/client.py | 2 +- roundup/scripts/roundup_server.py | 3 --- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index 7161378..96fedf3 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -29,6 +29,8 @@ Fixes: 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) diff --git a/doc/acknowledgements.txt b/doc/acknowledgements.txt index 8ab9058..13793dc 100644 --- a/doc/acknowledgements.txt +++ b/doc/acknowledgements.txt @@ -58,6 +58,7 @@ Tobias Herp, Uwe Hoffmann, Alex Holkner, Tobias Hunger, +Werner Hunger, Simon Hyde, Paul Jimenez, Christophe Kalt, diff --git a/roundup/cgi/client.py b/roundup/cgi/client.py index b66b39b..3b10238 100644 --- a/roundup/cgi/client.py +++ b/roundup/cgi/client.py @@ -300,7 +300,7 @@ class Client: # 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 diff --git a/roundup/scripts/roundup_server.py b/roundup/scripts/roundup_server.py index 266edb9..12a2d00 100644 --- a/roundup/scripts/roundup_server.py +++ b/roundup/scripts/roundup_server.py @@ -188,8 +188,6 @@ class RoundupRequestHandler(BaseHTTPServer.BaseHTTPRequestHandler): """ 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 @@ class RoundupRequestHandler(BaseHTTPServer.BaseHTTPRequestHandler): # out to the logfile print 'EXCEPTION AT', ts traceback.print_exc() - sys.stdin = save_stdin do_GET = do_POST = do_HEAD = run_cgi -- 2.30.2