Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
BUG: mod_wsgi restricting access to stdout throws unhandled IOError. #21552
We're using pandas on the backend of our internal web server for a few utilities. Any attempt to import the library causes an IOError to be thrown due to our setup of mod_wsgi restricting stdout access by default (WSGIRestrictStdout On).
The cause of this error is an attempt to get the client encoding on init when registering options. A call is made to detect_client_encoding() in console.py under pandas/io/formats/ which is throwing the IOError. The call to sys.stdout.encoding in this function is contained inside a try/except block, however, the except statement is limited to an AttributeError.
I propose we expand this except statement to allow for both AttributeErrors and IOErrors.