Skip to content

Commit

Permalink
Merge pull request #25 from evanpw/fix_retry
Browse files Browse the repository at this point in the history
BUG: _retry_read_url retries connection even if successful
  • Loading branch information
davidastephens committed Mar 26, 2015
2 parents 1cb3bb7 + 061c736 commit 19de6c1
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions pandas_datareader/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,14 +172,14 @@ def _retry_read_url(url, retry_count, pause, name):
if len(rs) > 2 and rs.index[-1] == rs.index[-2]: # pragma: no cover
rs = rs[:-1]

#Get rid of unicode characters in index name.
try:
rs.index.name = rs.index.name.decode('unicode_escape').encode('ascii', 'ignore')
except AttributeError:
#Python 3 string has no decode method.
rs.index.name = rs.index.name.encode('ascii', 'ignore').decode()
#Get rid of unicode characters in index name.
try:
rs.index.name = rs.index.name.decode('unicode_escape').encode('ascii', 'ignore')
except AttributeError:
#Python 3 string has no decode method.
rs.index.name = rs.index.name.encode('ascii', 'ignore').decode()

return rs
return rs

raise IOError("after %d tries, %s did not "
"return a 200 for url %r" % (retry_count, name, url))
Expand Down

0 comments on commit 19de6c1

Please sign in to comment.