Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion pandas_datareader/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class _BaseReader(object):
_format = 'string'

def __init__(self, symbols, start=None, end=None,
retry_count=3, pause=0.1, session=None):
retry_count=3, pause=0.1, timeout=30, session=None):
self.symbols = symbols

start, end = self._sanitize_dates(start, end)
Expand All @@ -55,6 +55,7 @@ def __init__(self, symbols, start=None, end=None,
raise ValueError("'retry_count' must be integer larger than 0")
self.retry_count = retry_count
self.pause = pause
self.timeout = timeout
self.session = self._init_session(session, retry_count)

def _init_session(self, session, retry_count):
Expand Down
2 changes: 1 addition & 1 deletion pandas_datareader/edgar.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ def _fix_old_file_paths(self, path):

def read(self):
try:
self._sec_ftp_session = FTP(_SEC_FTP)
self._sec_ftp_session = FTP(_SEC_FTP, timeout=self.timeout)
self._sec_ftp_session.login()
except EOFError:
raise RemoteDataError('FTP server has closed the connection.')
Expand Down