openaddresses/pyesridump

Source doesn't work with `--proxy`

Closed this issue · 4 comments

This command fails:

(esridump) [step9581@SHess pyesridump (master)]$ esri2geojson --proxy=http://map.nca.by/proxy.php http://arcgisserver:8399/arcgis/rest/services/ADDRESS_NEW/MapServer/0 belarus.geojson
Traceback (most recent call last):
  File "/Users/step9581/git/openaddresses/pyesridump/esridump/bin/esri2geojson", line 11, in <module>
    sys.exit(main())
  File "/Users/step9581/git/openaddresses/pyesridump/esridump/lib/python3.6/site-packages/esridump/cli.py", line 103, in main
    feature = next(feature_iter)
  File "/Users/step9581/git/openaddresses/pyesridump/esridump/lib/python3.6/site-packages/esridump/dumper.py", line 263, in __iter__
    metadata = self.get_metadata()
  File "/Users/step9581/git/openaddresses/pyesridump/esridump/lib/python3.6/site-packages/esridump/dumper.py", line 133, in get_metadata
    response = self._request('GET', url, params=query_args, headers=headers)
  File "/Users/step9581/git/openaddresses/pyesridump/esridump/lib/python3.6/site-packages/esridump/dumper.py", line 37, in _request
    url += '?' + urllib.urlencode(kwargs.get('params'))
AttributeError: module 'urllib' has no attribute 'urlencode'

I think when we added #38 we didn't check this path with python3.

Turns out this wasn't broken!

@trescube, please try upgrading to a newer version of pyesridump and try again.

Sweet! I did a git pull the other day and saw some updates but haven't revisited yet. I'll check it out tomorrow!

I had to blow away the directory and re-clone (probably to remove an artifact of something pip installed), but that fixed it!