Skip to content

Commit 679aef3

Browse files
committed
Handle case when response.encoding is None
1 parent 4245330 commit 679aef3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pandas_datareader/base.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,8 @@ def _get_response(self, url, params=None, headers=None):
133133
if response.status_code == requests.codes.ok:
134134
return response
135135

136-
last_response_text = response.text.encode(response.encoding)
136+
if response.encoding:
137+
last_response_text = response.text.encode(response.encoding)
137138
time.sleep(pause)
138139

139140
# Increase time between subsequent requests, per subclass.

0 commit comments

Comments
 (0)