-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: SSL handshake error with Python 3.10 and Pandas read_csv for URLs #47189
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
Comments
Thanks @turnerm for the report.
from that post...
I'm no security expert, but that can only be a bad thing?
I don't think pandas should implement any workarounds that weaken security, so removing the bug label and labelling as won't fix and closing candidate to see what others think. |
I'm using python 3.10.4 on Fedora 36. I have no issues reading this CSV file! On an older machine with python 3.10, I get the reported SSL error. I assume the certificates/openssl installed on that machine might be too old. edit: and according to ssllabs the site supports TLS 1.2. I assume that your openssl installations does not support 1.2. |
I'm a bit out of my depth at this point, but in case it's useful information, I do believe my machine supports 1.2:
I first encountered this error on GitHub actions, also when running on Ubuntu 20.04 (same as my machine). |
Me too :) The older machine on which I also get the error, also seems to support TLS 1.2. I think the issue is related to the python/openssl installation - unfortunately, I don't know what is wrong (I would assume it works when you upgrade to Ubuntu 22.04/Fedora 36). Pandas simply uses urllib (and fsspec) to open URLs. If you believe that this is not an issue with the python/openssl installation, please feel free to open an issue at urllib. |
Closing as won't fix on our side |
Pandas version checks
I have checked that this issue has not already been reported.
I have confirmed this bug exists on the latest version of pandas.
I have confirmed this bug exists on the main branch of pandas.
Reproducible Example
Issue Description
With Python 3.10, reading the CHIRPS rainfall data csv file from the URL in the provided example fails with the following error:
This error is not present in Python 3.6-3.9. I suspect it is due to the increased security for default TLS settings in Python 3.10. A workaround I found based on this SO post:
Expected Behavior
The csv should be read correctly into a dataframe, and should look like:
(Note that this dataset is not completely static, the date may eventually change, but it should be of a similar format)
Installed Versions
INSTALLED VERSIONS
commit : 3bf2cb1
python : 3.10.4.final.0
python-bits : 64
OS : Linux
OS-release : 5.13.0-41-generic
Version : #46~20.04.1-Ubuntu SMP Wed Apr 20 13:16:21 UTC 2022
machine : x86_64
processor : x86_64
byteorder : little
LC_ALL : None
LANG : en_US.UTF-8
LOCALE : en_US.UTF-8
pandas : 1.5.0.dev0+849.g3bf2cb1b2
numpy : 1.22.4
pytz : 2022.1
dateutil : 2.8.2
setuptools : 58.1.0
pip : 22.1.2
Cython : None
pytest : None
hypothesis : None
sphinx : None
blosc : None
feather : None
xlsxwriter : 3.0.3
lxml.etree : 4.9.0
html5lib : None
pymysql : None
psycopg2 : None
jinja2 : 3.1.2
IPython : 8.4.0
pandas_datareader: None
bs4 : None
bottleneck : None
brotli : None
fastparquet : None
fsspec : 2022.5.0
gcsfs : None
matplotlib : None
numba : None
numexpr : None
odfpy : None
openpyxl : 3.0.10
pandas_gbq : None
pyarrow : None
pyreadstat : None
pyxlsb : None
s3fs : None
scipy : None
snappy : None
sqlalchemy : None
tables : None
tabulate : 0.8.9
xarray : 2022.3.0
xlrd : 2.0.1
xlwt : 1.3.0
zstandard : None
The text was updated successfully, but these errors were encountered: