Fails with "ImportError: cannot import name exceptions". I'll attach the patch found in the FreeBSD bug report. Typical error message: One or more notifiers crashed. You may want to send the following traceback(s) to the author: ------------------------------------------------------------------------------ Notifier: svnmailer.util.TruncatingDecorator Revision: 22 Groups: [u'portage group'] Traceback (most recent call last): File "/usr/lib64/python2.5/site-packages/svnmailer/main.py", line 101, in run notifier.run() File "/usr/lib64/python2.5/site-packages/svnmailer/notifier/_mail.py", line 62, in run for mail in self.getMails(): File "/usr/lib64/python2.5/site-packages/svnmailer/notifier/_mail.py", line 83, in getMails for mail in self.composeMail(): File "/usr/lib64/python2.5/site-packages/svnmailer/notifier/_multimail.py", line 163, in composeMail self.writeNotification() File "/usr/lib64/python2.5/site-packages/svnmailer/notifier/_mail.py", line 96, in writeNotification self.writeDiffList() File "/usr/lib64/python2.5/site-packages/svnmailer/notifier/_multimail.py", line 221, in writeDiffList super(MultiMailNotifier, self).writeDiffList() File "/usr/lib64/python2.5/site-packages/svnmailer/notifier/_text.py", line 183, in writeDiffList self.writeContentDiff(change) File "/usr/lib64/python2.5/site-packages/svnmailer/notifier/_multimail.py", line 240, in writeContentDiff self.diff_file_list.append(DiffDescriptor(self, tmpfile, change)) File "/usr/lib64/python2.5/site-packages/svnmailer/notifier/_multimail.py", line 629, in __init__ enc1, enc2 = notifier.getContentEncodings(change, None) File "/usr/lib64/python2.5/site-packages/svnmailer/notifier/_base.py", line 348, in getContentEncodings from encodings import exceptions ImportError: cannot import name exceptions
Created attachment 143318 [details, diff] Make svnmailer work under python-2.5, but breaks backwards compatibility.
As far as I can tell the patch is compatible with Python 2.4.
I assumed it would break under python-2.4 because exceptions where no longer imported. Why was the import there in the first place then? python-2.3 remnants?
Yep, it comes probably from 2.3. In 2.4 both encodings.exceptions.LookupError and LookupError exists.
Does the patch break python 2.3 compatibility (Python 2.3 is in portage) Could it in that case just be applied conditionally (only if python 2.4/2.5 is installed)?
(In reply to comment #5) > Does the patch break python 2.3 compatibility (Python 2.3 is in portage) No, LookupError is also part of python2.3's global namespace. For the infidels: $ python2.3 -c "print LookupError" exceptions.LookupError $ python2.4 -c "print LookupError" exceptions.LookupError $ python2.5 -c "print LookupError" <type 'exceptions.LookupError'> So please, go ahead.
committed -r2 with patch
Cool! Many thanks!