Closed chassain closed 6 years ago
Seems we have an encoding issue. Same error wuth Besançon.
Starting Kalliope
Press Ctrl+C for stopping
Starting order signal
je suis prête
Waiting for trigger detection
Que puis-je faire pour vous?
[SpeechRecognition] Threshold set to: 4000
Say something!
Google Speech Recognition thinks you said quel temps fait-il à Besançon
Order matched in the brain. Running synapse "get-the-weather"
Exception in thread <class 'kalliope.signals.order.order.Order'>:
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 801, in bootstrap_inner
self.run()
File "/usr/local/lib/python2.7/dist-packages/kalliope-0.5.1-py2.7.egg/kalliope/signals/order/order.py", line 84, in run
self.start_trigger()
File "build/bdist.linux-armv7l/egg/transitions/core.py", line 383, in trigger
return self.machine._process(func)
File "build/bdist.linux-armv7l/egg/transitions/core.py", line 1059, in _process
self._transition_queue0
File "build/bdist.linux-armv7l/egg/transitions/core.py", line 399, in _trigger
return self._process(event_data)
File "build/bdist.linux-armv7l/egg/transitions/core.py", line 409, in _process
if trans.execute(event_data):
File "build/bdist.linux-armv7l/egg/transitions/core.py", line 263, in execute
self._change_state(event_data)
File "build/bdist.linux-armv7l/egg/transitions/core.py", line 274, in _change_state
event_data.machine.get_state(self.dest).enter(event_data)
File "build/bdist.linux-armv7l/egg/transitions/core.py", line 120, in enter
event_data.machine.callback(handle, event_data)
File "build/bdist.linux-armv7l/egg/transitions/core.py", line 1005, in callback
func(event_data.args, *event_data.kwargs)
File "/usr/local/lib/python2.7/dist-packages/kalliope-0.5.1-py2.7.egg/kalliope/signals/order/order.py", line 182, in analysing_order_thread
is_api_call=False)
File "/usr/local/lib/python2.7/dist-packages/kalliope-0.5.1-py2.7.egg/kalliope/core/SynapseLauncher.py", line 97, in run_matching_synapse_from_order
execdata = lifo_buffer.execute(is_api_call=is_api_call)
File "/usr/local/lib/python2.7/dist-packages/kalliope-0.5.1-py2.7.egg/kalliope/core/Lifo/LIFOBuffer.py", line 109, in execute
self._process_synapse_list(last_synapse_fifo_list)
File "/usr/local/lib/python2.7/dist-packages/kalliope-0.5.1-py2.7.egg/kalliope/core/Lifo/LIFOBuffer.py", line 139, in _process_synapse_list
self._process_neuron_list(matched_synapse=matched_synapse)
File "/usr/local/lib/python2.7/dist-packages/kalliope-0.5.1-py2.7.egg/kalliope/core/Lifo/LIFOBuffer.py", line 173, in _process_neuron_list
parameters_dict=matched_synapse.parameters)
File "/usr/local/lib/python2.7/dist-packages/kalliope-0.5.1-py2.7.egg/kalliope/core/NeuronLauncher.py", line 62, in start_neuron
instantiated_neuron = NeuronLauncher.launch_neuron(neuron)
File "/usr/local/lib/python2.7/dist-packages/kalliope-0.5.1-py2.7.egg/kalliope/core/NeuronLauncher.py", line 44, in launch_neuron
resources_dir=neuron_folder)
File "/usr/local/lib/python2.7/dist-packages/kalliope-0.5.1-py2.7.egg/kalliope/core/Utils/Utils.py", line 140, in get_dynamic_class_instantiation
return klass(parameters)
File "resources/neurons/openweathermap/openweathermap.py", line 26, in init__
forecast = owm.daily_forecast(extended_location)
File "/usr/local/lib/python2.7/dist-packages/pyowm/webapi25/owm25.py", line 589, in daily_forecast
encoded_name = OWM25._encode_string(name)
File "/usr/local/lib/python2.7/dist-packages/pyowm/webapi25/owm25.py", line 102, in _encode_string
return value.encode('utf8')
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 5: ordinal not in range(128)
This works (placed at the beginning of the init method
import sys
reload(sys)
sys.setdefaultencoding("utf-8")
Fixed and merged in master
Hi, i have error when i say "quel temps fait-il à Hyères":
unicodedecodeerror 'ascii' codec can't decode byte Oxc3 in position 2: ordinal not in range (128)
All city whitout accent are ok (grenoble, brest,...). Encode utf8 is used in file python 2.7. Thanks for help. (and sorry for english)