Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: mod_wsgi restricting access to stdout throws unhandled IOError. #21552

Closed
JayOfferdahl opened this issue Jun 20, 2018 · 0 comments · Fixed by #21531
Closed

BUG: mod_wsgi restricting access to stdout throws unhandled IOError. #21552

JayOfferdahl opened this issue Jun 20, 2018 · 0 comments · Fixed by #21531
Labels
IO Data IO issues that don't fit into a more specific label
Milestone

Comments

@JayOfferdahl
Copy link
Contributor

Problem description

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.

Details

INSTALLED VERSIONS

commit: e2d5958
python: 2.7.15.final.0
python-bits: 64
OS: Linux
OS-release: 4.16.14-300.fc28.x86_64
machine: x86_64
processor: x86_64
byteorder: little
LC_ALL: None
LANG: en_US.UTF-8
LOCALE: None.None

pandas: 0.24.0.dev0+118.ge2d5958bb
pytest: 3.6.1
pip: 9.0.3
setuptools: 39.2.0
Cython: 0.28.3
numpy: 1.14.5
scipy: None
pyarrow: None
xarray: None
IPython: None
sphinx: None
patsy: None
dateutil: 2.7.3
pytz: 2018.4
blosc: None
bottleneck: None
tables: None
numexpr: None
feather: None
matplotlib: None
openpyxl: None
xlrd: None
xlwt: None
xlsxwriter: None
lxml: None
bs4: None
html5lib: None
sqlalchemy: None
pymysql: None
psycopg2: None
jinja2: None
s3fs: None
fastparquet: None
pandas_gbq: None
pandas_datareader: None

@WillAyd WillAyd added the IO Data IO issues that don't fit into a more specific label label Jun 21, 2018
@jreback jreback added this to the 0.24.0 milestone Sep 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
IO Data IO issues that don't fit into a more specific label
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants