Repository: weecology/retriever

Issue:
Error while installing BBS and BBS50 on python2
```
goelakas@ubuntu:~/dev/retriever$ retriever install --debug csv BBS
=> Installing USGS North American Breeding Bird Survey
Progress: 746 / 746 rows inserted into ./BBS_species.csv:
Progress: 5627 / 5627 rows inserted into ./BBS_routes.csv:
Progress: 116098 / 116098 rows inserted into ./BBS_weather.csv:
Progress: 97 / 97 rows inserted into ./BBS_region_codes.csv:
Inserting data from Alabama...
Progress: 156801 / 156801 rows inserted into ./BBS_counts.csv:
Inserting data from Alaska...
Downloading /home/goelakas/.retriever/raw_data/BBS/Alaska.zip...
Progress: 63195 / 219996 rows inserted into ./BBS_counts.csv:
Inserting data from Arizona...
Downloading /home/goelakas/.retriever/raw_data/BBS/Arizona.zip...
Failed bulk insert on Arizona, inserting manually.
Downloading /home/goelakas/.retriever/raw_data/BBS/Arizona.zip...
There was an error in Arizona.
[Errno ftp error] 200 Switching to Binary mode.
Traceback (most recent call last):
 File "/usr/local/bin/retriever", line 11, in <module>
   load_entry_point('retriever==2.0.dev0', 'console_scripts', 'retriever')()
 File "/usr/local/lib/python2.7/dist-packages/retriever-2.0.dev0-py2.7.egg/retriever/__main__.py", line 176, in main
   dataset.download(engine, debug=debug)
 File "/home/goelakas/.retriever/scripts/bbs.py", line 179, in download
   [shortstate + ".csv"])
 File "/usr/local/lib/python2.7/dist-packages/retriever-2.0.dev0-py2.7.egg/retriever/lib/engine.py", line 636, in insert_data_from_archive
   self.download_files_from_archive(url, filenames)
 File "/usr/local/lib/python2.7/dist-packages/retriever-2.0.dev0-py2.7.egg/retriever/lib/engine.py", line 450, in download_files_from_archive
   self.download_file(url, archivename)
 File "/usr/local/lib/python2.7/dist-packages/retriever-2.0.dev0-py2.7.egg/retriever/lib/engine.py", line 423, in download_file
   urlretrieve(url, path)
 File "/usr/lib/python2.7/urllib.py", line 98, in urlretrieve
   return opener.retrieve(url, filename, reporthook, data)
 File "/usr/lib/python2.7/urllib.py", line 245, in retrieve
   fp = self.open(url, data)
 File "/usr/lib/python2.7/urllib.py", line 213, in open
   return getattr(self, name)(url)
 File "/usr/lib/python2.7/urllib.py", line 558, in open_ftp
   (fp, retrlen) = self.ftpcache[key].retrfile(file, type)
 File "/usr/lib/python2.7/urllib.py", line 906, in retrfile
   conn, retrlen = self.ftp.ntransfercmd(cmd)
 File "/usr/lib/python2.7/ftplib.py", line 334, in ntransfercmd
   host, port = self.makepasv()
 File "/usr/lib/python2.7/ftplib.py", line 312, in makepasv
   host, port = parse227(self.sendcmd('PASV'))
 File "/usr/lib/python2.7/ftplib.py", line 830, in parse227
   raise error_reply, resp
IOError: [Errno ftp error] 200 Switching to Binary mode.
```


Discussion:

Resolving patch:
diff --git a/lib/engine.py b/lib/engine.py
--- a/lib/engine.py
+++ b/lib/engine.py
@@ -16,10 +16,7 @@
 import tarfile
 import csv
 import io
-if sys.version_info[0] >= 3:
-    from urllib.request import urlretrieve
-else:
-    from urllib import urlretrieve
+from urllib.request import urlretrieve
 from retriever import DATA_SEARCH_PATHS, DATA_WRITE_PATH
 from retriever.lib.cleanup import no_cleanup
 from retriever.lib.warning import Warning


Test patch: