Skip to content

Commit c158362

Browse files
committed
[*] Python 2.7 compatible fix for russian literals.
1 parent 569883d commit c158362

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

pandas_datareader/moex.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import pandas as pd
44

55
from pandas_datareader.base import _DailyBaseReader
6-
from pandas_datareader.compat import StringIO, binary_type, concat, is_list_like
6+
from pandas_datareader.compat import StringIO, binary_type, concat, is_list_like, PY3
77

88

99
class MoexReader(_DailyBaseReader):
@@ -181,7 +181,11 @@ def read(self):
181181
break
182182

183183
if len(out_list) > 0:
184-
str_io = StringIO("\r\n".join(out_list))
184+
if PY3:
185+
str_io = StringIO("\r\n".join(out_list))
186+
else:
187+
str_io = StringIO("\r\n".join(out_list).encode('utf-8'))
188+
185189
dfs.append(self._read_lines(str_io)) # add a new DataFrame
186190
finally:
187191
self.close()

0 commit comments

Comments
 (0)