mmueller / supybot-git

A Git plugin for Supybot (a Python IRC bot)
45 stars 24 forks source link

Uncaught exception in UTF-8 git log #24

Closed Firefishy closed 9 years ago

Firefishy commented 10 years ago

UTF-8 encoding of Author "Paweł Paprota" is causing an exception. Source: git://github.com/ppawel/openstreetmap-watch-list.git

ERROR 2013-10-08T14:51:37 supybot Uncaught exception in ['git', 'log'].
Traceback (most recent call last):
  File "/usr/lib/pymodules/python2.7/supybot/callbacks.py", line 1180, in _callCommand
    self.callCommand(command, irc, msg, *args, **kwargs)
  File "/usr/lib/pymodules/python2.7/supybot/utils/python.py", line 86, in g
    f(self, *args, **kwargs)
  File "/usr/lib/pymodules/python2.7/supybot/callbacks.py", line 1166, in callCommand
    method(irc, msg, *args, **kwargs)
  File "/usr/local/lib/supybot/plugins/Git/plugin.py", line 593, in __call__
    return self.log_command(*args, **kwargs)
  File "/usr/lib/pymodules/python2.7/supybot/commands.py", line 913, in newf
    f(self, irc, msg, args, *state.args, **state.kwargs)
  File "/usr/local/lib/supybot/plugins/Git/plugin.py", line 335, in _log
    self._reply_commits(irc, channel, repository, commits)
  File "/usr/local/lib/supybot/plugins/Git/plugin.py", line 413, in _reply_commits
    lines = repository.format_message(commit, format_str)
  File "/usr/local/lib/supybot/plugins/Git/plugin.py", line 82, in _synchronizer
    return func(self, *args, **kwargs)
  File "/usr/local/lib/supybot/plugins/Git/plugin.py", line 261, in format_message
    result.append(outline.encode('utf-8'))
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc5 in position 20: ordinal not in range(128)
ERROR 2013-10-08T14:51:37 supybot Exception id: 0x80cd2
mmueller commented 10 years ago

Hrm, I don't reproduce this. I'm running GitPython 0.3.2.RC1 and supybot 0.84.0-dev (this may be a git version, it's been a while since I installed it). Can you tell me what versions you've got?

Firefishy commented 10 years ago

Packaged versions that come with Ubuntu 12.04.

I'll have a go with an updated GitPython version.

mmueller commented 10 years ago

Yeah, distro-packaged versions tend to be fairly old. The best way to go with Python is to install virtualenv and install packages via pip, whenever possible. Let me know how it goes.

3kynox commented 10 years ago

Hello I wa having the same error.

Problem is using requirements file in project, it install old gitpython and mock, don't ask me why. pip uninstallling that and check your distro updated packages, relaunch bot, and it works.