Skip to content

Commit 44b2495

Browse files
nehaleckyy-p
authored and
y-p
committed
BUG: Fixed decode issue in get_data_yahoo() GH2847
1 parent be533f6 commit 44b2495

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pandas/io/data.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ def get_quote_yahoo(symbols):
115115
return None
116116

117117
for line in lines:
118-
fields = line.strip().split(',')
118+
fields = line.decode('utf-8').strip().split(',')
119119
for i, field in enumerate(fields):
120120
if field[-2:] == '%"':
121121
data[header[i]].append(float(field.strip('"%')))
@@ -252,7 +252,7 @@ def get_components_yahoo(idx_sym):
252252
#break when no new components are found
253253
while (True in mask):
254254
urlStr = url.format(idx_mod, stats, comp_idx)
255-
lines = (urllib.urlopen(urlStr).read().strip().
255+
lines = (urllib.urlopen(urlStr).read().decode('utf-8').strip().
256256
strip('"').split('"\r\n"'))
257257

258258
lines = [line.strip().split('","') for line in lines]

0 commit comments

Comments
 (0)