jvandal / modwsgi

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

Log.isatty should be a method, not an attribute. #146

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Hi there. :)

According to Issue 82 in mod_wsgi 2.4 the Log class grew a close() method
and an isatty attribute to better support Mercurial.

isatty should be a method, however, as per the Python docs for file objects
(http://docs.python.org/library/stdtypes.html#file.isatty).

This bug causes TracMetrixPlugin
(http://trac-hacks.org/wiki/TracMetrixPlugin) to crash Trac. 
TracMetrixPlugin uses matplotlib, which uses numpy, which has the following
test:

  if hasattr(sys.stdout,'isatty') and sys.stdout.isatty():

in numpy/distutils/misc_util.py at line 243.

Anyway, hope this bug report helps.  Thanks for the very excellent mod_wsgi! :D

Take care,
Krys Wilken

Original issue reported on code.google.com by kryswil...@gmail.com on 7 May 2009 at 6:16

GoogleCodeExporter commented 8 years ago
Since the documentation says:

'''Note If a file-like object is not associated with a real file, this method 
should not be implemented.'''

I am actually inclined to remove it again. I didn't realise documentation said 
that and it shows that code which 
was calling it shouldn't have been assuming it existed, although Mercurial code 
was at least fixed up to check 
first whether it existed.

Interesting, documentation also says about 'closed' attribute:

'''These are not required for file-like objects, but should be implemented if 
they make sense for the particular 
object.'''

So again, Mercurial shouldn't have been assuming closed attribute existed. But 
then, maybe the issue with 
'closed' attribute was a different package and not Mercurial. :-)

Original comment by Graham.Dumpleton@gmail.com on 7 May 2009 at 11:22

GoogleCodeExporter commented 8 years ago
The isatty attribute removed in revision 1312 of trunk for 3.0.

Original comment by Graham.Dumpleton@gmail.com on 11 May 2009 at 3:50

GoogleCodeExporter commented 8 years ago
Also removed in revision 1313 of 2.X branch for 2.5.

Original comment by Graham.Dumpleton@gmail.com on 11 May 2009 at 4:00

GoogleCodeExporter commented 8 years ago
Released mod_wsgi 2.5.

Original comment by Graham.Dumpleton@gmail.com on 11 May 2009 at 11:45