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

urllib2.URLError: <urlopen error [Errno 8] _ssl.c:504: EOF occurred in violation of protocol> #10

Open
jesselangdon opened this issue Oct 6, 2017 · 0 comments

Comments

@jesselangdon
Copy link

jesselangdon commented Oct 6, 2017

Thanks for this great tool! I am using get_modis as a submodule in my own repo (STeAMM), and recently updated to the latest version, and while testing, I encountered this error:

  File "C:\dev\STeAMM\STeAMM\externals\get_modis\get_modis.py", line 249, in get_modisfiles
    dates = parse_modis_dates(url, dates, product, out_dir, ruff=ruff)
  File "C:\dev\STeAMM\STeAMM\externals\get_modis\get_modis.py", line 143, in parse_modis_dates
    html = return_url(url)
  File "C:\dev\STeAMM\STeAMM\externals\get_modis\get_modis.py", line 105, in return_url
    html = urllib2.urlopen(req).readlines()
  File "C:\OSGeo4W\apps\Python27\lib\urllib2.py", line 127, in urlopen
    return _opener.open(url, data, timeout)
  File "C:\OSGeo4W\apps\Python27\lib\urllib2.py", line 404, in open
    response = self._open(req, data)
  File "C:\OSGeo4W\apps\Python27\lib\urllib2.py", line 422, in _open
    '_open', req)
  File "C:\OSGeo4W\apps\Python27\lib\urllib2.py", line 382, in _call_chain
    result = func(*args)
  File "C:\OSGeo4W\apps\Python27\lib\urllib2.py", line 1222, in https_open
    return self.do_open(httplib.HTTPSConnection, req)
  File "C:\OSGeo4W\apps\Python27\lib\urllib2.py", line 1184, in do_open
    raise URLError(err)
urllib2.URLError: <urlopen error [Errno 8] _ssl.c:504: EOF occurred in violation of protocol>

When I call the get_modis function, I use the default base_url (i.e. "http://e4ftl01.cr.usgs.gov"), so I'm not sure what's going on (I'm a bit of a noob). I'm assuming there's something weird going on with the urllib2 module's use of the SSL protocol, but I'm not sure what exactly.

Here are the parameters being supplied to the parse_modis_dates function (line 249):

dates = ['2015.01.01', '2015.01.02', '2015.01.03', '2015.01.04', '2015.01.05', '2015.01.06', '2015.01.07', '2015.01.08']
out_dir = '.'
product = 'MOD11A1.005'
ruff = False
url = ''http://e4ftl01.cr.usgs.gov/MOLT/MOD11A1.005/''
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant