Skip to content

Commit cf53146

Browse files
committed
BUG: zipfile import
Closes pydata#280
1 parent 556205d commit cf53146

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

pandas_datareader/edgar.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from pandas import read_csv
77
from pandas import DataFrame
88
from pandas import to_datetime
9-
from pandas.io.common import ZipFile
9+
import zipfile
1010
from pandas.compat import StringIO
1111
from pandas.core.common import is_number
1212

@@ -65,7 +65,7 @@ def _read_zipfile(self, ftppath):
6565
except EOFError:
6666
raise RemoteDataError('FTP server has closed the connection.')
6767
zipf.seek(0)
68-
with ZipFile(zipf, 'r') as zf:
68+
with zipfile.ZipFile(zipf, 'r') as zf:
6969
data = zf.open(zf.namelist()[0]).read().decode()
7070

7171
return StringIO(data)

pandas_datareader/famafrench.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import tempfile
22
import re
33
import datetime as dt
4-
from pandas.io.common import ZipFile
4+
import zipfile
55
from pandas.compat import lmap, StringIO
66
from pandas import read_csv, to_datetime
77

@@ -61,7 +61,7 @@ def _read_zipfile(self, url):
6161
with tempfile.TemporaryFile() as tmpf:
6262
tmpf.write(raw)
6363

64-
with ZipFile(tmpf, 'r') as zf:
64+
with zipfile.ZipFile(tmpf, 'r') as zf:
6565
data = zf.open(zf.namelist()[0]).read().decode()
6666

6767
return data

0 commit comments

Comments
 (0)