census-shapefile-utils icon indicating copy to clipboard operation
census-shapefile-utils copied to clipboard

Connection reset by peer

Open palewire opened this issue 5 years ago • 2 comments

$ python fetch_shapefiles.py  
Finding files in: ftp://ftp2.census.gov/geo/tiger/TIGER2012/CD/ ...
Traceback (most recent call last):
  File "fetch_shapefiles.py", line 208, in <module>
    main()
  File "fetch_shapefiles.py", line 203, in main
    year=options.year
  File "fetch_shapefiles.py", line 146, in get_all_geo_types
    get_one_geo_type(geo_type, state, year)
  File "fetch_shapefiles.py", line 133, in get_one_geo_type
    filename_list = get_filename_list_from_ftp(target, state)
  File "fetch_shapefiles.py", line 51, in get_filename_list_from_ftp
    target_files = urllib2.urlopen(target).read().splitlines()
  File "/usr/lib/python2.7/urllib2.py", line 154, in urlopen
    return opener.open(url, data, timeout)
  File "/usr/lib/python2.7/urllib2.py", line 429, in open
    response = self._open(req, data)
  File "/usr/lib/python2.7/urllib2.py", line 447, in _open
    '_open', req)
  File "/usr/lib/python2.7/urllib2.py", line 407, in _call_chain
    result = func(*args)
  File "/usr/lib/python2.7/urllib2.py", line 1413, in ftp_open
    fw = self.connect_ftp(user, passwd, host, port, dirs, req.timeout)
  File "/usr/lib/python2.7/urllib2.py", line 1435, in connect_ftp
    persistent=False)
  File "/usr/lib/python2.7/urllib.py", line 877, in __init__
    self.init()
  File "/usr/lib/python2.7/urllib.py", line 886, in init
    self.ftp.connect(self.host, self.port, self.timeout)
  File "/usr/lib/python2.7/ftplib.py", line 138, in connect
    self.welcome = self.getresp()
  File "/usr/lib/python2.7/ftplib.py", line 215, in getresp
    resp = self.getmultiline()
  File "/usr/lib/python2.7/ftplib.py", line 201, in getmultiline
    line = self.getline()
  File "/usr/lib/python2.7/ftplib.py", line 186, in getline
    line = self.file.readline(self.maxline + 1)
  File "/usr/lib/python2.7/socket.py", line 480, in readline
    data = self._sock.recv(self._rbufsize)
urllib2.URLError: <urlopen error ftp error: [Errno 104] Connection reset by peer>

palewire avatar Mar 28 '19 06:03 palewire

Same issue. I'll see if the API key is required and report back.

smitty1eGH avatar Sep 30 '19 00:09 smitty1eGH

Old issue, but I'm having the same problem. Did you ever reach a solution?

mattppal avatar Mar 09 '23 19:03 mattppal