Utf-8 codec error

Hi

I receive the following error running a simple current data code.


def initialize(context):
    context.run_once = False
    context.security = symbol('AAPL')

def handle_data(context, data):
    print(get_datetime().strftime("%Y-%m-%d %H:%M:%S %Z"))
    print(data.current(context.security, 'price'))
   # print ("SPY ask_price=", show_real_time_price(symbol('SPY'), 'ask_price'))


----------------------------

 
IBridgePy version 5.0.3
fileName = newTest.py
####    Starting to initialize trader    ####
##    ACCOUNT Balance  DU195183  ##
CASH=898332.07
portfolio_value=898741.41
positions_value=0.0
##    NO ANY POSITION    ##
##    NO any order    ##
####    Initialize trader COMPLETED    ####
2019-05-13 05:45:46 EDT
Traceback (most recent call last):
  File "C:/Jts/IBridgePy_Win_Anaconda37_64/RUN_ME.py.py", line 40, in <module>
    exec(script)
  File "<string>", line 39, in <module>
  File "<string>", line 17, in <module>
  File "C:\Jts\IBridgePy_Win_Anaconda37_64\IBridgePy\MarketManagerBase.py", line 67, in run
    self.run_regular()
  File "C:\Jts\IBridgePy_Win_Anaconda37_64\IBridgePy\MarketManagerBase.py", line 85, in run_regular
    re.repeat()
  File "C:\Jts\IBridgePy_Win_Anaconda37_64\IBridgePy\IbridgepyTools.py", line 588, in repeat
    event.do_something(timeNow)
  File "C:\Jts\IBridgePy_Win_Anaconda37_64\IBridgePy\TraderBasicResources.py", line 120, in repeat_Function
    self.handle_data_quantopian(self.context, self.qData)
  File "<string>", line 10, in handle_data
  File "C:\Jts\IBridgePy_Win_Anaconda37_64\IBridgePy\quantopian.py", line 224, in current
    return self.current_one(security, field)
  File "C:\Jts\IBridgePy_Win_Anaconda37_64\IBridgePy\quantopian.py", line 228, in current_one
    return self.parentTrader.show_real_time_price(security, version)
  File "C:\Jts\IBridgePy_Win_Anaconda37_64\IBridgePy\TraderBasicResources.py", line 213, in show_real_time_price
    return self.brokerService.get_real_time_price(security, adj_param)
  File "C:\Jts\IBridgePy_Win_Anaconda37_64\broker_factory\interactiveBrokers.py", line 86, in get_real_time_price
    self.request_data(10, 0, ReqData.reqMktData(security, followUp=True))
  File "C:\Jts\IBridgePy_Win_Anaconda37_64\broker_factory\broker.py", line 86, in request_data
    return self.brokerClient.request_data(waitForFeedbackInSeconds, repeat, *args)
  File "C:\Jts\IBridgePy_Win_Anaconda37_64\broker_client_factory\RequestImpl.py", line 132, in request_data
    self.processMessages()
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xf6 in position 75: invalid start byte

Process finished with exit code 1

If you are using Windows, go to “Windows Settings” –> “Region & Language”. Then change region to “United States” and language to “English”.



Link for the same:




http://www.ibridgepy.com/q-a/#Q_UnicodeDecodeError_8216utf-88217_codec_can8217t_decode_byte_0xb2_in_position_0_invalid_start_byte