jaraco / irc

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

Byte decode error #41

Closed jaraco closed 8 years ago

jaraco commented 8 years ago

I'm currently using this library to create an IRC bot embedded into a plugin for another bot (www.bigbrotherbot.net) and I stepped into this error. This is an extract from my log file. Did someone experience this already? This actually cause my bots to crash every now and then since the exception breaks the main loop and interrupt the thread.

#!

140716 00:38:33 ERROR   'STDERR \'Exception in thread Thread-2:\\nTraceback (most recent call last):\\n  File "/usr/lib/python2.7/threading.py", line 552, in __bootstrap_inner\\n    self.run()\\n  File "/usr/lib/python2.7/threading.py", line 505, in run\\n    self.__target(*self.__args, **self.__kwargs)\\n  File "/usr/local/lib/python2.7/dist-packages/irc/bot.py", line 266, in start\\n    super(SingleServerIRCBot, self).start()\\n  File "/usr/local/lib/python2.7/dist-packages/irc/client.py", line 1263, in start\\n    self.manifold.process_forever()\\n  File "/usr/local/lib/python2.7/dist-packages/irc/client.py", line 280, in process_forever\\n    self.process_once(timeout)\\n  File "/usr/local/lib/python2.7/dist-packages/irc/client.py", line 261, in process_once\\n    self.process_data(i)\\n  File "/usr/local/lib/python2.7/dist-packages/irc/client.py", line 218, in process_data\\n    c.process_data()\\n  File "/usr/local/lib/python2.7/dist-packages/irc/client.py", line 575, in process_data\\n    for line in self.buffer:\\n  File "/usr/local/lib/python2.7/dist-packages/irc/buffer.py", line 94, in lines\\n    self.handle_exception()\\n  File "/usr/local/lib/python2.7/dist-packages/irc/buffer.py", line 92, in lines\\n    yield line.decode(self.encoding, self.errors)\\n  File "/usr/lib/python2.7/encodings/utf_8.py", line 16, in decode\\n    return codecs.utf_8_decode(input, errors, True)\\nUnicodeDecodeError: \\\'utf8\\\' codec can\\\'t decode byte 0xe8 in position 66: invalid continuation byte\\n\\n\'

jaraco commented 8 years ago

Duplicate of #40.


Original comment by: Jason R. Coombs

jaraco commented 8 years ago

Ouch....I swear I tried to look for an already open issue....must have skipped that one..thanks for the prompt reply and keep up the good work


Original comment by: Daniele Pantaleone

jaraco commented 8 years ago

No sweat. I agree this is a pain point in the library, but I also believe the pain is worth it, emphasizing the best practice, but providing a technique for supporting client in less capable environments.


Original comment by: Jason R. Coombs