CloudBotIRC / CloudBot

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

Issues with unicode and logging on Windows #23

Closed dmptrluke closed 9 years ago

dmptrluke commented 9 years ago
[21:53:54][INFO] [esper:#dmptr] <Luke> .tw dmptrluke
[21:53:57][INFO] [esper:#dmptr] <Luke> .tw notch
[21:53:57][INFO] [esper] >> PRIVMSG #dmptr :(Luke) @DmptrLuke (Luke Rogers): @misscliks @LivinpinkSC2 @missharvey @AnnaProsser Halp, part 5 of the latest misscliks is private on youtube D: (1 day, 1 hour ago)
[21:53:58][INFO] [esper] >> PRIVMSG #dmptr :(Luke) ✓@notch (Markus Persson): @KyleMcCarthy lol good one lol (12 hours, 2 minutes ago)
--- Logging error ---
Traceback (most recent call last):
  File "C:\Python34\lib\logging\__init__.py", line 980, in emit
    stream.write(msg)
  File "C:\Python34\lib\encodings\cp1252.py", line 19, in encode
    return codecs.charmap_encode(input,self.errors,encoding_table)[0]
UnicodeEncodeError: 'charmap' codec can't encode character '\u2713' in position 63: character maps to <undefined>
Call stack:
  File "C:/Users/Luke/PycharmProjects/CloudBotRefresh/cloudbot/__main__.py", line 92, in <module>
    main()
  File "C:/Users/Luke/PycharmProjects/CloudBotRefresh/cloudbot/__main__.py", line 64, in main
    restart = cloudbot.run()
  File "C:\Users\Luke\PycharmProjects\CloudBotRefresh\cloudbot\bot.py", line 115, in run
    restart = self.loop.run_until_complete(self.stopped_future)
  File "C:\Python34\lib\asyncio\base_events.py", line 263, in run_until_complete
    self.run_forever()
  File "C:\Python34\lib\asyncio\base_events.py", line 236, in run_forever
    self._run_once()
  File "C:\Python34\lib\asyncio\base_events.py", line 1048, in _run_once
    handle._run()
  File "C:\Python34\lib\asyncio\events.py", line 119, in _run
    self._callback(*self._args)
  File "C:\Users\Luke\PycharmProjects\CloudBotRefresh\cloudbot\clients\irc.py", line 198, in _send
    logger.info("[{}] >> {}".format(self.readable_name, line))
Message: '[esper] >> PRIVMSG #dmptr :(Luke) ✓@\x02notch\x02 (Markus Persson): @KyleMcCarthy lol good one lol (12 hours, 2 minutes ago)'
Arguments: ()
--- Logging error ---
Traceback (most recent call last):
  File "C:\Python34\lib\logging\__init__.py", line 980, in emit
    stream.write(msg)
  File "C:\Python34\lib\encodings\cp1252.py", line 19, in encode
    return codecs.charmap_encode(input,self.errors,encoding_table)[0]
UnicodeEncodeError: 'charmap' codec can't encode character '\u2713' in position 63: character maps to <undefined>
Call stack:
  File "C:/Users/Luke/PycharmProjects/CloudBotRefresh/cloudbot/__main__.py", line 92, in <module>
    main()
  File "C:/Users/Luke/PycharmProjects/CloudBotRefresh/cloudbot/__main__.py", line 64, in main
    restart = cloudbot.run()
  File "C:\Users\Luke\PycharmProjects\CloudBotRefresh\cloudbot\bot.py", line 115, in run
    restart = self.loop.run_until_complete(self.stopped_future)
  File "C:\Python34\lib\asyncio\base_events.py", line 263, in run_until_complete
    self.run_forever()
  File "C:\Python34\lib\asyncio\base_events.py", line 236, in run_forever
    self._run_once()
  File "C:\Python34\lib\asyncio\base_events.py", line 1048, in _run_once
    handle._run()
  File "C:\Python34\lib\asyncio\events.py", line 119, in _run
    self._callback(*self._args)
  File "C:\Users\Luke\PycharmProjects\CloudBotRefresh\cloudbot\clients\irc.py", line 198, in _send
    logger.info("[{}] >> {}".format(self.readable_name, line))
Message: '[esper] >> PRIVMSG #dmptr :(Luke) ✓@\x02notch\x02 (Markus Persson): @KyleMcCarthy lol good one lol (12 hours, 2 minutes ago)'
Arguments: ()
[21:54:03][INFO] [esper:#dmptr] <Luke> o shit
dmptrluke commented 9 years ago

I have no idea @daboross, take a look when you can <3

dmptrluke commented 9 years ago

I've fixed this, no need! :)