mirror of
https://github.com/wassname/geopandas.git
synced 2026-09-10 12:00:21 +08:00
PY3: Use io.open to write bytes in python 2/3
This commit is contained in:
+2
-1
@@ -1,3 +1,4 @@
|
||||
import io
|
||||
import os.path
|
||||
from six.moves.urllib.request import urlopen
|
||||
|
||||
@@ -28,7 +29,7 @@ def download_nybb():
|
||||
# saved as geopandas/examples/nybb_13a.zip.
|
||||
filename = os.path.join('examples', 'nybb_13a.zip')
|
||||
if not os.path.exists(filename):
|
||||
with open(filename, 'w') as f:
|
||||
with io.open(filename, 'wb') as f:
|
||||
response = urlopen('http://www.nyc.gov/html/dcp/download/bytes/nybb_13a.zip')
|
||||
f.write(response.read())
|
||||
return filename
|
||||
|
||||
Reference in New Issue
Block a user