From 0c80da73d551fdb1748501830d09d3a73d754bc5 Mon Sep 17 00:00:00 2001 From: Kelsey Jordahl Date: Wed, 16 Apr 2014 12:54:49 -0400 Subject: [PATCH] PY3: Use io.open to write bytes in python 2/3 --- tests/util.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/util.py b/tests/util.py index 77a6683..1118953 100644 --- a/tests/util.py +++ b/tests/util.py @@ -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