Closed paris-ci closed 8 years ago
That's a unicode error in "/home/cloudbot/CloudBot/plugins/log.py", line 242. It looks weird because of the threading.
The logging error can be fixed by changing your server local to utf-8.
@edwardslabs I can't find such option in the config. Could you be more precise ?
@paris-ci your server's locale is likely set to a non-UTF-8 languange you can see this with
echo $LANG
If you set your server's locale to en_US.UTF-8 or fr_FR.UTF-8 the bot will be able to write unicode text to the file system.
Oh, you mean the physical server !
root@api-d:~# echo $LANG
fr_FR.UTF-8
cloudbot@api-d:~/CloudBot$ echo $LANG
fr_FR.UTF-8
But still the same error :(
Did you restart the bot? If $LANG was already set to fr_FR.UTF-8 can you try en_US.UTF-8?
I did, and the language was set like that for ages. I'll try to change the locate to en_US.UTF-8, and i'll tell you the result
It seems to work with that locale !
Is changing the server locale really considered the fix? This bug crashes the bot for me.
--- Logging error ---
Traceback (most recent call last):
File "/usr/lib/python3.4/logging/__init__.py", line 980, in emit
stream.write(msg)
UnicodeEncodeError: 'ascii' codec can't encode character '\xe9' in position 67: ordinal not in range(128)
Call stack:
File "/usr/lib/python3.4/runpy.py", line 170, in _run_module_as_main
"__main__", mod_spec)
File "/usr/lib/python3.4/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/home/cloud_bot/CloudBot/cloudbot/__main__.py", line 85, in <module>
main()
File "/home/cloud_bot/CloudBot/cloudbot/__main__.py", line 57, in main
restart = _bot.run()
File "/home/cloud_bot/CloudBot/cloudbot/bot.py", line 132, in run
restart = self.loop.run_until_complete(self.stopped_future)
File "/usr/lib/python3.4/asyncio/base_events.py", line 304, in run_until_complete
self.run_forever()
File "/usr/lib/python3.4/asyncio/base_events.py", line 276, in run_forever
self._run_once()
File "/usr/lib/python3.4/asyncio/base_events.py", line 1172, in _run_once
handle._run()
File "/usr/lib/python3.4/asyncio/events.py", line 120, in _run
self._callback(*self._args)
File "/home/cloud_bot/CloudBot/cloudbot/clients/irc.py", line 210, in _send
logger.info("[{}] >> {}".format(self.name, line))
Message: '[BaphoNet] >> PRIVMSG #savagegods :(Generic) \x02Pok\xe9mon Theme Song\x02 - length \x023m 22s\x02 - 129,398 likes, 4,162 dislikes (\x0296.9\x02%) - \x0221,055,093\x02 views - \x02Arcanine299\x02 on \x022008.03.30\x02 - http://youtu.be/JuYeHPFR3f0'
Arguments: ()
There is a python hack to pull every string ever created to utf8 but that could cause issues else where. Change your locale to the utf variant.
On 17/03/2016, Mikkel Jeppesen notifications@github.com wrote:
Is changing the server locale really considered the fix? This bug crashes the bot for me.
--- Logging error --- Traceback (most recent call last): File "/usr/lib/python3.4/logging/__init__.py", line 980, in emit stream.write(msg) UnicodeEncodeError: 'ascii' codec can't encode character '\xe9' in position 67: ordinal not in range(128) Call stack: File "/usr/lib/python3.4/runpy.py", line 170, in _run_module_as_main "__main__", mod_spec) File "/usr/lib/python3.4/runpy.py", line 85, in _run_code exec(code, run_globals) File "/home/cloud_bot/CloudBot/cloudbot/__main__.py", line 85, in <module> main() File "/home/cloud_bot/CloudBot/cloudbot/__main__.py", line 57, in main restart = _bot.run() File "/home/cloud_bot/CloudBot/cloudbot/bot.py", line 132, in run restart = self.loop.run_until_complete(self.stopped_future) File "/usr/lib/python3.4/asyncio/base_events.py", line 304, in run_until_complete self.run_forever() File "/usr/lib/python3.4/asyncio/base_events.py", line 276, in run_forever self._run_once() File "/usr/lib/python3.4/asyncio/base_events.py", line 1172, in _run_once handle._run() File "/usr/lib/python3.4/asyncio/events.py", line 120, in _run self._callback(*self._args) File "/home/cloud_bot/CloudBot/cloudbot/clients/irc.py", line 210, in _send logger.info("[{}] >> {}".format(self.name, line)) Message: '[BaphoNet] >> PRIVMSG #savagegods :(Generic) \x02Pok\xe9mon Theme Song\x02 - length \x023m 22s\x02 - 129,398 likes, 4,162 dislikes (\x0296.9\x02%) - \x0221,055,093\x02 views - \x02Arcanine299\x02 on \x022008.03.30\x02 - http://youtu.be/JuYeHPFR3f0' Arguments: ()
You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/CloudBotIRC/CloudBot/issues/177#issuecomment-197772790