jaraco / irc

Full-featured Python IRC library for Python.
MIT License
392 stars 86 forks source link

Unicode-related crashes #52

Closed jaraco closed 8 years ago

jaraco commented 8 years ago

My basic irc bot has crashed two times seemingly at random. I haven't seen messages directly preceding it's crash, but judging from the error log below, I guess it was given non-unicode data?

I'm ready to provide more info on this, if it happens again.

#!python

Traceback (most recent call last):
  File "/home/git/inzbot/inzbot.py", line 96, in <module>
    main()
  File "/home/git/inzbot/inzbot.py", line 92, in main
    bot.start()
  File "/usr/local/lib/python3.2/dist-packages/irc/bot.py", line 265, in start
    super(SingleServerIRCBot, self).start()
  File "/usr/local/lib/python3.2/dist-packages/irc/client.py", line 1274, in start
    self.reactor.process_forever()
  File "/usr/local/lib/python3.2/dist-packages/irc/client.py", line 276, in process_forever
    self.process_once(timeout)
  File "/usr/local/lib/python3.2/dist-packages/irc/client.py", line 257, in process_once
    self.process_data(i)
  File "/usr/local/lib/python3.2/dist-packages/irc/client.py", line 214, in process_data
    c.process_data()
  File "/usr/local/lib/python3.2/dist-packages/irc/client.py", line 580, in process_data
    for line in self.buffer:
  File "/usr/local/lib/python3.2/dist-packages/irc/buffer.py", line 96, in lines
    self.handle_exception()
  File "/usr/local/lib/python3.2/dist-packages/irc/buffer.py", line 94, in lines
    yield line.decode(self.encoding, self.errors)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xf3 in position 72: invalid continuation byte

jaraco commented 8 years ago

I've gotten similar crashes, also seemingly randomly.


Original comment by: Dan Brinkman

jaraco commented 8 years ago

Duplicate of #40.


Original comment by: Jason R. Coombs

jaraco commented 8 years ago

Also, I created #54 to capture need for better direction in this scenario.


Original comment by: Jason R. Coombs