2009/9/11 Greg <[email protected]>:
>
> I did see those - the thing is that the html2text script isn't
> actually printing anything, it's just obtaining a reference to the
> sys.stdout.write method. I didn't expect that to throw an error.

Yes, I know that. This is one of the corner cases. I have kept
updating the dummy log object to cater for these but for mod_wsgi 3.0
just decided to default to not bothering to check so had stopped
putting in code to deal with these corner cases. I guess though since
they are doing that, I will have to anyway for 2.6 and for 3.0 where
someone wants to enable it to check for portability.

Graham

> Cheers,
> Greg
>
> On Sep 9, 2:41 pm, Graham Dumpleton <[email protected]>
> wrote:
>> 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_St...
>>  http://blog.dscpl.com.au/2009/04/wsgi-and-printing-to-standard-output...
>>
>> 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