anlutro / botologist

Plugin-driven Python3 IRC
MIT License
5 stars 5 forks source link

😵 #72

Closed x89 closed 8 years ago

x89 commented 8 years ago
Traceback (most recent call last):
  File "/usr/local/lib/python3.4/logging/__init__.py", line 980, in emit
    stream.write(msg)
UnicodeEncodeError: 'ascii' codec can't encode character '\U0001f635' in position 128: ordinal not in range(128)
Call stack:
  File "/usr/local/lib/python3.4/threading.py", line 879, in _bootstrap
    self._bootstrap_inner()
  File "/usr/local/lib/python3.4/threading.py", line 911, in _bootstrap_inner
    self.run()
  File "/usr/local/lib/python3.4/threading.py", line 859, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/home/napalm/botologist/botologist/error.py", line 62, in wrapped
    func(*args, **kwargs)
  File "/usr/home/napalm/botologist/botologist/protocol/irc.py", line 136, in _connect
    self.loop()
  File "/usr/home/napalm/botologist/botologist/protocol/irc.py", line 155, in loop
    log.debug('RECEIVED: %s', repr(msg))
Message: 'RECEIVED: %s'
Arguments: ("':x89!~idk@unaffiliated/wew PRIVMSG #chan :\U0001f635'",)
anlutro commented 8 years ago

I can't reproduce this... though it might be because I'm not sure I'm sending the correct unicode characters through my IRC client!

x89 commented 8 years ago

Hmm.

Tested locally and there's no issue, tested on my FreeBSD VM and it gives that error. I updated it from Python 3.4 to 3.5 and it's the same thing.

There's no "no-utf" config option is there? :D

anlutro commented 8 years ago

Does FreeBSD not allow you to write UTF-8 to log files using the logging module? I guess that kinda makes sense but seems odd.

x89 commented 8 years ago

It does it based on your locale, this VM didn't have UTF-8 locales. Case closed!