capturestdout in utils.py doesn't work with lighttpd fastcgi in some cases
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
web.py |
Fix Released
|
Undecided
|
Anand Chitipothu |
Bug Description
Because capturestdout changes stdout, it causes lighttpd using fastcgi not to work for me. Additionally, changing a descriptor like this might not be thread-safe. Since capturestdout is used only once, attached is a patch that replaces the use of capturestdout in utils.py:
--- old/webpy/
+++ new/webpy/
@@ -617,6 +617,7 @@
self.func = func
def __call__(self, *args): ##, **kw): kw unused
import hotshot, hotshot.stats, tempfile ##, time already imported
+ import cStringIO
temp = tempfile.
prof = hotshot.
@@ -629,8 +630,11 @@
x = '\n\ntook '+ str(stime) + ' seconds\n'
- x += capturestdout(
- x += capturestdout(
+ out = cStringIO.
+ stats.stream = out
+ stats.print_
+ stats.print_
+ x += out.getvalue()
return result, x
profile = Profile
Changed in webpy: | |
status: | Fix Committed → Fix Released |
fixed.
http:// github. com/webpy/ webpy/commit/ 3900e41556669e3 ef4b7be4209ffa1 31df7003d1