tcalmant / ipopo

iPOPO: a Service-Oriented Component Model for Python
https://ipopo.readthedocs.io/
Apache License 2.0
69 stars 28 forks source link

UnicodeDecodeError caused by a log from core.py #80

Closed ogattaz closed 7 years ago

ogattaz commented 7 years ago

The line 158 of core.py is a declaration of a property ??? self.running = False

Mac OS 10.11.6 + Python 2.7.13 installed using Homebrew 1.2.1

The error appears 3 times : ` 2017-06-02 12:56:45,342:DEBUG :cohorte.vote.core : Coup d'état by xxxx-isolate python Traceback (most recent call last): File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/logging/init.py", line 884, in emit stream.write(fs % msg.encode("UTF-8")) UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 86: ordinal not in range(128) Logged from file core.py, line 158

2017-06-02 12:56:45,343:DEBUG :cohorte.vote.core : Coup d'état by xxxx-isolate python Traceback (most recent call last): File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/logging/init.py", line 884, in emit stream.write(fs % msg.encode("UTF-8")) UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 86: ordinal not in range(128) Logged from file core.py, line 158

2017-06-02 12:56:45,343:DEBUG :cohorte.vote.core : Coup d'état by xxxx-isolate python Traceback (most recent call last): File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/logging/init.py", line 884, in emit stream.write(fs % msg.encode("UTF-8")) UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 86: ordinal not in range(128) Logged from file core.py, line 158 `

tcalmant commented 7 years ago

Hi, The stack trace references in fact the cohorte.vote.core module, from the Cohorte Runtime project. See core.py@158.

The problem comes from the trace being logged contains UTF-8 characters, but the logging seems to use an output stream that doesn't support that encoding.

The easiest solution is to remove UTF-8 characters and stay with universal ASCII characters.

Another solution would be to make the console output UTF-compatible, e.g. by setting the locale of the shell running the application based on UTF-8.

ogattaz commented 7 years ago

OK, thanks Thomas. We are going to remove the french characters from our message !