devcartel / pyrfa

Open sourced Python API for Refinitiv (Thomson Reuters) Enterprise Platform.
http://devcartel.com/pyrfa
MIT License
50 stars 15 forks source link

utf-8 issue with python36 #27

Closed adamb032 closed 7 years ago

adamb032 commented 7 years ago

I just upgraded to python36 and using your binaries i get the following issue doing a basic

p.getTimeSeries(ric) #request

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xf7 in position 0: invalid start byte

Please advise.

wiwat-tharateeraparb commented 7 years ago

@adamb032 what's your PyRFA version?

adamb032 commented 7 years ago

8.2.0

thanks -

wiwat-tharateeraparb commented 7 years ago

How about this http://devcartel.com/blog/14156297

wiwat-tharateeraparb commented 7 years ago

Run below command on your terminal:

$ export PYTHONIOENCODING=utf-8

Or Windows equivalent:

C:\> chcp 65001
snb2013 commented 5 years ago

It doesn't help. Config:

\Connections\Connection_RSSL1\rsslPort = "14002"
\Connections\Connection_RSSL1\ServerList = "REPLACE_TO_SERVER_NAME"
\Connections\Connection_RSSL1\connectionType = "RSSL"
\Connections\Connection_RSSL1\UserName = "REPLACE_TO_USER_NAME"
\Connections\Connection_RSSL1\Position = "127.0.0.1"
\Connections\Connection_RSSL1\ServiceName = "ELEKTRON_CONNECT"
\Sessions\Session1\connectionList = "Connection_RSSL1"

Example:

import pyrfa

p = pyrfa.Pyrfa()
p.createConfigDb("./pyrfa.cfg")
p.acquireSession("Session1")
p.createOMMConsumer()
p.login()
p.directoryRequest()
p.dictionaryRequest()

print(p.getTimeSeries("USDAM3L1Y="))

I've tried Python3.5 and Python 3.6. Pyrfa version is 8.5.2. Usage: PYTHONIOENCODING=utf-8 python3.6 timeseries.py Error:

Traceback (most recent call last):
  File "/SOME_ROOT/timeseries.py", line 11, in <module>
    print(p.getTimeSeries("USDAM3L1Y="))
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xed in position 0: unexpected end of data