On 30 March 2010 19:27, Manlio Perillo <manlio_peri...@libero.it> wrote: > Manlio Perillo ha scritto: >> Hi. >> >> Some time ago, someone reported me that an application embedded in Nginx >> with my WSGI module failed to execute, since in my implementation the >> wsgi.errors object does not implement the .close method. >> >> [...] >> Any idea? >> > > Here is the culprit: > http://lists.alioth.debian.org/pipermail/python-modules-team/2009-January/003514.html > http://code.google.com/p/modwsgi/issues/detail?id=82 > > So it seems safe, when the Log object used in wsgi.errors is also used > to replace sys.stderr, to just add the closed attribute (but *not* the > close method).
It is all very silly. Technically a file like object is not required to have a 'closed' attribute, so that code expecting it was wrong in the first place. http://docs.python.org/library/stdtypes.html#file-objects The close() method is however required of file like objects so if you are going to replace a file like object, you should have it. All you can really do is supply as many of the methods, attributes as possible, all required and as many as optional as makes sense, because you can't trust people to read the documentation properly. Graham _______________________________________________ Web-SIG mailing list Web-SIG@python.org Web SIG: http://www.python.org/sigs/web-sig Unsubscribe: http://mail.python.org/mailman/options/web-sig/archive%40mail-archive.com