Copterfly / modwsgi

Automatically exported from code.google.com/p/modwsgi
0 stars 0 forks source link

The mod_wsgi.Log object does not have a 'closed' attribute #125

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
This bugreport was filed in the Debian BTS
(http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=512633):

The mod_wsgi.Log object does not have a 'closed' attribute.

Some background: The Hatta wiki engine uses a Mercurial repository as
storage for it's data. It does this by directly importing the needed
parts of Mercurial, not by running the actual hg command. In my case
this lead to trouble when my Mercurial repository was in a funky state
due to completely unrelated reasons.

Mercurial wanted to print an error message to sys.stdout. This would've
been easy to correct with the sys.stdout=sys.stderr-trick, except
Mercurial contains code such as "if not sys.stdout.closed:
sys.stdout.flush()" and the same for stderr. The mod_wsgi.Log object
that replaces sys.stderr doesn't have the closed attribute, so the code
fails and debugging a minor problem with the repo turned into an
interresting project.

It would be nice if an always false closed-attribute could be added to 
the Log object for additional compatibility even with code that isn't
originally meant to be used with wsgi.

Original issue reported on code.google.com by bernd.ze...@gmail.com on 22 Jan 2009 at 12:40

GoogleCodeExporter commented 8 years ago
See:

  http://code.google.com/p/modwsgi/issues/detail?id=82

It is arguable that Mercurial code is rather sloppily written and shouldn't be 
checking 'closed' to begin with.

Anyway, issue is addressed in mod_wsgi 3.0.

Original comment by Graham.Dumpleton@gmail.com on 22 Jan 2009 at 2:53