2009/9/9 Greg <[email protected]>:
>
> Hi Graham,
>
> I'm getting an
>
>    IOError: sys.stdout access restricted by mod_wsgi
>
> error from an unexpected source. The offending code is a class
> definition in html2text.py (http://www.aaronsw.com/2002/html2text/)
>
>    class _html2text(sgmllib.SGMLParser):
>        def __init__(self, out=sys.stdout.write, baseurl=''):
>    ...
>
> Not sure whether this should be considered an issue with mod_wsgi or
> not, but the script isn't actually attempting to print anything - the
> class is not even initialised in my code.

Read:

  
http://code.google.com/p/modwsgi/wiki/ApplicationIssues#Writing_To_Standard_Output
  http://blog.dscpl.com.au/2009/04/wsgi-and-printing-to-standard-output.html

The intent was to stop people from writing to sys.stdout for debugging
as doing so makes WSGI applications non portable.

I have given up pushing this barrow because the majority, rather than
fix there code, seem happier to disable the complaints. There are also
some corner cases as you have found which are hard to deal with.

Anyway, in mod_wsgi 3.0, the restriction is off by default and would
have to be enabled. Ie., opposite of now.

Graham

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"modwsgi" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/modwsgi?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to