Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scenario: Unicode issue on other commands #525

Open
axboct opened this issue Jul 26, 2017 · 0 comments
Open

Scenario: Unicode issue on other commands #525

axboct opened this issue Jul 26, 2017 · 0 comments

Comments

@axboct
Copy link

axboct commented Jul 26, 2017

Simple test Scenario: сomparison of value and output to the log

log below, used string combined cyrillic and latin "Привет от Domogik"

2017-07-26 18:12:21,462 domogik-scenario INFO Scenario 2 deleted
2017-07-26 18:12:21,462 domogik-scenario INFO Create or save scenario : name = '2', id = '2', json = '{"type":"controls_if","id":"CXeRaH*|O;%(XRY0~0(d","IF0":{"type":"logic_compare","id":"z#!~|7.zGj?F6],$2/*|","OP":"NEQ","A":{"type":"sensor.SensorTest.48","id":"cT|?[c-Wn]OiD.QKD6.]","usage.usage":"value"},"B":{"type":"DT_mbarPressure","id":"|]b^_rYLzX8a;z,[ymaL","NUM":"1000"}},"DO0":{"type":"log.LogAction","id":"W(%]u@n/X7H-e%~Nnp1_","message":{"type":"text","id":"t[}^sj87,RQMt(21lH(a","TEXT":"Привет от Domogik"}}}'
2017-07-26 18:12:21,593 domogik-scenario.test DEBUG Create test instance sensor.SensorTest.48 with uuid fd21a36e-8dfe-4fd6-8fe1-5ee02bb9e2aa
2017-07-26 18:12:21,759 domogik-scenario.test DEBUG Trigger <bound method ScenarioInstance.generic_trigger of <domogik.scenario.scenario.ScenarioInstance instance at 0x7f959c18e0e0>> called by parameter <domogik.scenario.parameters.sensor_usage.SensorUsageParameter instance at 0x7f959c14dfc8>
2017-07-26 18:12:21,759 domogik-scenario.test DEBUG Create action instance log.LogAction with uuid f375fca5-9f2e-4f92-af76-0b729f603ad1
2017-07-26 18:12:21,759 domogik-scenario.test INFO Scenario 'test' : configure the trigger to the last item of each test instance
2017-07-26 18:12:21,760 domogik-scenario.test DEBUG Scenario 'test' : test instance : sensor.SensorTest.48 (1 items)
2017-07-26 18:12:21,760 domogik-scenario.test DEBUG Set trigger for item '0' to generic_trigger
2017-07-26 18:12:21,760 domogik-scenario.test DEBUG Scenario 'test' python generated code : 
print('---- Start evaluating ----')
if ( self._mapping['test']['fd21a36e-8dfe-4fd6-8fe1-5ee02bb9e2aa'].evaluate() != float("1000") ):
    self._mapping['action']['0-f375fca5-9f2e-4f92-af76-0b729f603ad1'].set_param("message", ("Привет от Domogik"))
    self._mapping['action']['0-f375fca5-9f2e-4f92-af76-0b729f603ad1'].do_action()

2017-07-26 18:12:21,759 domogik-scenario.test DEBUG Eval the condition!
2017-07-26 18:12:21,762 domogik-scenario.test DEBUG Evaluate SensorTest '48' in mode 'value' to '995.0'. Type is '<type 'float'>'
2017-07-26 18:12:21,762 domogik-scenario.test ERROR Error while evaluating condition '<code object <module> at 0x7f959c1f09b0, file "Scenario test", line 1>'. Error is : Traceback (most recent call last):
  File "/home/sasa/domogik/src/domogik/scenario/scenario.py", line 428, in eval_condition
    exec(self._compiled_condition)
  File "Scenario test", line 4, in <module>
  File "/home/sasa/domogik/src/domogik/scenario/actions/log.py", line 42, in do_action
    self._log.info(u"{0}".format(message))
UnicodeDecodeError: 'ascii' codec can't decode byte 0xd0 in position 0: ordinal not in range(128)

2017-07-26 18:12:21,761 domogik-scenario DEBUG Create scenario instance test with payload {u'IF0': {u'A': {u'type': u'sensor.SensorTest.48', u'id': u'cT|?[c-Wn]OiD.QKD6.]', u'usage.usage': u'value'}, u'B': {u'NUM': u'1000', u'type': 'math_number', u'id': u'|]b^_rYLzX8a;z,[ymaL'}, u'type': u'logic_compare', u'id': u'z#!~|7.zGj?F6],$2/*|', u'OP': u'NEQ'}, u'DO0': {u'message': {u'TEXT': u'\u041f\u0440\u0438\u0432\u0435\u0442 \u043e\u0442 Domogik', u'type': u'text', u'id': u't[}^sj87,RQMt(21lH(a'}, u'type': u'log.LogAction', u'id': u'W(%]u@n/X7H-e%~Nnp1_'}, u'type': u'controls_if', u'id': u'CXeRaH*|O;%(XRY0~0(d'}
2017-07-26 18:12:21,763 domogik-scenario.test DEBUG Eval the condition!
2017-07-26 18:12:21,763 domogik-scenario.test DEBUG Evaluate SensorTest '48' in mode 'value' to '995.0'. Type is '<type 'float'>'
2017-07-26 18:12:21,763 domogik-scenario.test ERROR Error while evaluating condition '<code object <module> at 0x7f959c1f09b0, file "Scenario test", line 1>'. Error is : Traceback (most recent call last):
  File "/home/sasa/domogik/src/domogik/scenario/scenario.py", line 428, in eval_condition
    exec(self._compiled_condition)
  File "Scenario test", line 4, in <module>
  File "/home/sasa/domogik/src/domogik/scenario/actions/log.py", line 42, in do_action
    self._log.info(u"{0}".format(message))
UnicodeDecodeError: 'ascii' codec can't decode byte 0xd0 in position 0: ordinal not in range(128)

2017-07-26 18:12:21,764 domogik-scenario ERROR Creation of a scenario failed. Error is : Traceback (most recent call last):
  File "/home/sasa/domogik/src/domogik/scenario/manager.py", line 238, in create_scenario
    self._instances[cid]['instance'].eval_condition()
  File "/home/sasa/domogik/src/domogik/scenario/scenario.py", line 428, in eval_condition
    exec(self._compiled_condition)
  File "Scenario test", line 4, in <module>
  File "/home/sasa/domogik/src/domogik/scenario/actions/log.py", line 42, in do_action
    self._log.info(u"{0}".format(message))
UnicodeDecodeError: 'ascii' codec can't decode byte 0xd0 in position 0: ordinal not in range(128)

on command "Make the butler sey somethig"

2017-07-26 18:50:33,908 domogik-scenario DEBUG Create scenario instance test with payload {u'IF0': {u'A': {u'type': u'sensor.SensorTest.48', u'id': u'cT|?[c-Wn]OiD.QKD6.]', u'usage.usage': u'value'}, u'B': {u'NUM': u'1000', u'type': 'math_number', u'id': u'|]b^_rYLzX8a;z,[ymaL'}, u'type': u'logic_compare', u'id': u'z#!~|7.zGj?F6],$2/*|', u'OP': u'NEQ'}, u'DO0': {u'text': {u'TEXT': u'\u041f\u0440\u0438\u0432\u0435\u0442 \u043e\u0442 Domogik', u'type': u'text', u'id': u't[}^sj87,RQMt(21lH(a'}, u'type': u'butler.ButlerAction', u'id': u'~P3[Ni50s?-%$+Rv:#}}'}, u'type': u'controls_if', u'id': u'CXeRaH*|O;%(XRY0~0(d'}
2017-07-26 18:50:33,909 domogik-scenario.test DEBUG Eval the condition!
2017-07-26 18:50:33,909 domogik-scenario.test DEBUG Evaluate SensorTest '48' in mode 'value' to '995.0'. Type is '<type 'float'>'
2017-07-26 18:50:33,909 domogik-scenario.test ERROR Error while evaluating condition '<code object <module> at 0x7f959c0c1030, file "Scenario test", line 1>'. Error is : Traceback (most recent call last):
  File "/home/sasa/domogik/src/domogik/scenario/scenario.py", line 428, in eval_condition
    exec(self._compiled_condition)
  File "Scenario test", line 4, in <module>
  File "/home/sasa/domogik/src/domogik/scenario/actions/butler.py", line 63, in do_action
    self._log.info(u"Make the butler say '{0}'. ".format(text))
UnicodeDecodeError: 'ascii' codec can't decode byte 0xd0 in position 0: ordinal not in range(128)

2017-07-26 18:50:33,910 domogik-scenario ERROR Creation of a scenario failed. Error is : Traceback (most recent call last):
  File "/home/sasa/domogik/src/domogik/scenario/manager.py", line 238, in create_scenario
    self._instances[cid]['instance'].eval_condition()
  File "/home/sasa/domogik/src/domogik/scenario/scenario.py", line 428, in eval_condition
    exec(self._compiled_condition)
  File "Scenario test", line 4, in <module>
  File "/home/sasa/domogik/src/domogik/scenario/actions/butler.py", line 63, in do_action
    self._log.info(u"Make the butler say '{0}'. ".format(text))
UnicodeDecodeError: 'ascii' codec can't decode byte 0xd0 in position 0: ordinal not in range(128)
@axboct axboct changed the title Scenario: Unicode issue on ohter commands Scenario: Unicode issue on other commands Jul 26, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant