Prevent WSGI apps from touching sys.stdin by setting ui.interactive to False.
authorDirkjan Ochtman <dirkjan@ochtman.nl>
Fri, 07 Sep 2007 17:38:52 +0200
changeset 5289 ed6df6b1c29a
parent 5233 aea35488ea66
child 5290 05889b6b1468
child 5291 23651848d638
Prevent WSGI apps from touching sys.stdin by setting ui.interactive to False.
mercurial/hgweb/hgweb_mod.py
mercurial/hgweb/hgwebdir_mod.py
--- a/mercurial/hgweb/hgweb_mod.py	Fri Aug 31 22:31:43 2007 +0200
+++ b/mercurial/hgweb/hgweb_mod.py	Fri Sep 07 17:38:52 2007 +0200
@@ -65,7 +65,8 @@
 class hgweb(object):
     def __init__(self, repo, name=None):
         if type(repo) == type(""):
-            self.repo = hg.repository(ui.ui(report_untrusted=False), repo)
+            parentui = ui.ui(report_untrusted=False, interactive=False)
+            self.repo = hg.repository(parentui, repo)
         else:
             self.repo = repo
 
--- a/mercurial/hgweb/hgwebdir_mod.py	Fri Aug 31 22:31:43 2007 +0200
+++ b/mercurial/hgweb/hgwebdir_mod.py	Fri Sep 07 17:38:52 2007 +0200
@@ -83,7 +83,8 @@
             else:
                 yield config('web', 'motd', '')
 
-        parentui = self.parentui or ui.ui(report_untrusted=False)
+        parentui = self.parentui or ui.ui(report_untrusted=False,
+                                          interactive=False)
 
         def config(section, name, default=None, untrusted=True):
             return parentui.config(section, name, default, untrusted)