CloudBotIRC / CloudBot

CloudBot - The simple, fast, expandable, open-source Python IRC Bot!
GNU General Public License v3.0
273 stars 250 forks source link

UnicodeEncodeError: 'ascii' codec can't encode character '\xe4' #197

Closed ghost closed 8 years ago

ghost commented 8 years ago

Typing a character with an accent or something from a none US layout gives this error, such as åäö

Traceback

--- Logging error --- Traceback (most recent call last): File "/usr/lib/python3.4/logging/init.py", line 966, in emit stream.write(msg) UnicodeEncodeError: 'ascii' codec can't encode characters in position 52-53: ordinal not in range(128) Call stack: File "/usr/lib/python3.4/threading.py", line 888, in _bootstrap self._bootstrap_inner() File "/usr/lib/python3.4/threading.py", line 920, in _bootstrap_inner self.run() File "/usr/lib/python3.4/threading.py", line 868, in run self._target(_self._args, _self._kwargs) File "/usr/lib/python3.4/concurrent/futures/thread.py", line 65, in _worker work_item.run() File "/usr/lib/python3.4/concurrent/futures/thread.py", line 54, in run result = self.fn(_self.args, _self.kwargs) File "/home/Chi/Cloudbot/cloudbot/plugin.py", line 340, in _execute_hook_threaded return hook.function(*parameters) File "/home/Chi/Cloudbot/plugins/log.py", line 242, in console_log bot.logger.info(text) Message: '[serverr:#channel] \xe5\xf6'

edwardslabs commented 8 years ago

I think this is likely related to the locale settings on your server. If you change your locale to something like en_US.UTF-8 and restart the bot the error should go away.

ghost commented 8 years ago

Indeed, this was the cause, thanks!