Closed
Description
Code Sample, a copy-pastable example if possible
import pandas as pd
df = pd.read_csv('https://user-name:[email protected]:8080/get_content.csv')
# fails with urlopen error [Errno 11003] getaddrinfo failed Python2.7 as well as Python 3.x
Problem description
HTTPS basic auth is very common. This URL format works in Excel, other text editors, etc. This url works in requests
library. It seems like the scenario doesnt work because the underlying urlopen
doesnt work
# I think it fails because the underlying code here fails in pandas/io/common.py:
from urllib2 import urlopen as _urlopen
b = _urlopen('https://un-name:[email protected]:8080/get_content.csv')
# fails with urlopen error [Errno 11003] getaddrinfo failed
see stackoverflow issue urllib basic auth
Only way to overcome this is using requests
+ StringIO
?
Expected Output
be able to get a CSV loaded dataframe
Output of pd.show_versions()
python: 2.7.13.final.0
python-bits: 64
pandas: 0.20.1