Encoding detection code and mod_wsgi

17 views
Skip to first unread message

Jani Tiainen

unread,
Mar 6, 2015, 2:24:09 PM3/6/15
to sy...@googlegroups.com
Hi,

When trying to use SymPy with code that is ran under mod_wsgi starting up such a process crashes due encoding method detection, which uses sys.stdout, when trying to determine unicode capabilities. 

mod_wsgi reserves sys.stdout for any access and thus code fails. 

I created issue https://github.com/sympy/sympy/issues/9086  on issue tracker but I'll post it here as well:

When using sympy with mod_wsgi pretty printing (with unicode) tries to determine encoding of sys.stdout. When running under mod_wsgi sys.stdout is restricted from all access and thus causing a traceback.

Function in question is pretty_try_use_unicode()


Would it be just enough to add IOError to catched exceptions along with UnicodeError? Is there a better solution?


-- 


Jani Tiainen

Reply all
Reply to author
Forward
0 new messages