Skip to content

Commit fb43eca

Browse files
author
Richard Jones
committed
Fix thread safety with stdin in roundup-server
1 parent 20eb040 commit fb43eca

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

CHANGES.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ Fixes:
2929
issue2550632
3030
- Allow value to be specified to multilink form element templating, fixes
3131
issue2550613, thanks David Wolever
32+
- Fix thread safety with stdin in roundup-server, fixes issue2550596
33+
(thanks Werner Hunger)
3234

3335

3436
2009-12-21 1.4.11 (r4413)

doc/acknowledgements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ Tobias Herp,
5858
Uwe Hoffmann,
5959
Alex Holkner,
6060
Tobias Hunger,
61+
Werner Hunger,
6162
Simon Hyde,
6263
Paul Jimenez,
6364
Christophe Kalt,

roundup/cgi/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ def __init__(self, instance, request, env, form=None, translator=None):
300300

301301
# see if we need to re-parse the environment for the form (eg Zope)
302302
if form is None:
303-
self.form = cgi.FieldStorage(environ=env)
303+
self.form = cgi.FieldStorage(fp=request.rfile, environ=env)
304304
else:
305305
self.form = form
306306

roundup/scripts/roundup_server.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -188,8 +188,6 @@ def run_cgi(self):
188188
""" Execute the CGI command. Wrap an innner call in an error
189189
handler so all errors can be caught.
190190
"""
191-
save_stdin = sys.stdin
192-
sys.stdin = self.rfile
193191
try:
194192
self.inner_run_cgi()
195193
except client.NotFound:
@@ -226,7 +224,6 @@ def run_cgi(self):
226224
# out to the logfile
227225
print 'EXCEPTION AT', ts
228226
traceback.print_exc()
229-
sys.stdin = save_stdin
230227

231228
do_GET = do_POST = do_HEAD = run_cgi
232229

0 commit comments

Comments
 (0)