IndigoDomotics / indigo-pushover

Indigo plugin to send push notifications via Pushover.
MIT License
17 stars 11 forks source link

Problems with special characters like ü #26

Closed dawiinci closed 5 years ago

dawiinci commented 5 years ago
   Pushover Error                  Error in plugin execution ExecuteAction:

Traceback (most recent call last):
  File "plugin.py", line 119, in send
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 10: ordinal not in range(128)

I tried to send a value as a title in a message containing "Büro". This gives an error but sends the message regardless.

%%v:VAR_ID%%

jcs commented 5 years ago

All of the self.logger calls are passing unicode strings and msgTitle and msgBody are already encoded to UTF-8, but from this error message, the logger object is only taking ASCII input. I think this is an upstream problem and the Indigo Python framework needs to setup a logger that takes UTF-8 input.

FlyingDiver commented 5 years ago

Try this version and see if special characters work:

https://github.com/IndigoDomotics/indigo-pushover/releases/tag/1.5.4

indigodomo commented 5 years ago

All of the self.logger calls are passing unicode strings and msgTitle and msgBody are already encoded to UTF-8, but from this error message, the logger object is only taking ASCII input. I think this is an upstream problem and the Indigo Python framework needs to setup a logger that takes UTF-8 input.

I don't believe this is true as the Python logger module is already unicode ready. Joe, what was the correction?

FlyingDiver commented 5 years ago

Changed all string substitution and concatenation to use .format()

dawiinci commented 5 years ago

Problem ist unfortunately NOT fixed. The same error appears, but the message is sent out like before.

FlyingDiver commented 5 years ago

@dawiinci - what line in 1.5.4 is the error on?

dawiinci commented 5 years ago

It was on line 121:

Traceback (most recent call last): File "plugin.py", line 121, in send UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 20: ordinal not in range(128)

FlyingDiver commented 5 years ago

Please turn debugging on in the plugin prefs and do the send again, then post the log segment.

dawiinci commented 5 years ago

There is no additional content shown with debug. The error message is exactly the same as in 1.5.3.

FlyingDiver commented 5 years ago

Hmm. With debug on, the plugin should be logging the content of the fields it's preparing to send. Also, the line numbers should have changed. I want to make sure I know exactly what line is throwing the error.

You do have to restart the plugin to get the debug logging to work.

In any case, don't worry about it. I'm able to recreate the problem on my system now.

FlyingDiver commented 5 years ago

Fixed in (new) 1.5.4. I reused the release number since it was never officially released.

https://github.com/IndigoDomotics/indigo-pushover/releases/tag/1.5.4

Please test this version.

dawiinci commented 5 years ago

Thank you, it works in 1.5.4.