Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 209857

Summary: dev-util/svnmailer-1.0.8-r1 does not work with dev-lang/python-2.5*
Product: Gentoo Linux Reporter: Tais P. Hansen <tais.hansen>
Component: New packagesAssignee: Andrew Ross (RETIRED) <aross>
Severity: normal CC: arne_bab, coldwind, mephinet
Priority: High    
Version: 2007.0   
Hardware: All   
OS: Linux   
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 148333    
Attachments: Make svnmailer work under python-2.5, but breaks backwards compatibility.

Description Tais P. Hansen 2008-02-12 15:31:33 UTC
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/", line 101, in run
  File "/usr/lib64/python2.5/site-packages/svnmailer/notifier/", line 62, in run
    for mail in self.getMails():
  File "/usr/lib64/python2.5/site-packages/svnmailer/notifier/", line 83, in getMails
    for mail in self.composeMail():
  File "/usr/lib64/python2.5/site-packages/svnmailer/notifier/", line 163, in composeMail
  File "/usr/lib64/python2.5/site-packages/svnmailer/notifier/", line 96, in writeNotification
  File "/usr/lib64/python2.5/site-packages/svnmailer/notifier/", line 221, in writeDiffList
    super(MultiMailNotifier, self).writeDiffList()
  File "/usr/lib64/python2.5/site-packages/svnmailer/notifier/", line 183, in writeDiffList
  File "/usr/lib64/python2.5/site-packages/svnmailer/notifier/", line 240, in writeContentDiff
    self.diff_file_list.append(DiffDescriptor(self, tmpfile, change))
  File "/usr/lib64/python2.5/site-packages/svnmailer/notifier/", line 629, in __init__
    enc1, enc2 = notifier.getContentEncodings(change, None)
  File "/usr/lib64/python2.5/site-packages/svnmailer/notifier/", line 348, in getContentEncodings
    from encodings import exceptions
ImportError: cannot import name exceptions
Comment 1 Tais P. Hansen 2008-02-12 15:32:06 UTC
Created attachment 143318 [details, diff]
Make svnmailer work under python-2.5, but breaks backwards compatibility.
Comment 2 Santiago M. Mola (RETIRED) gentoo-dev 2008-02-12 20:07:45 UTC
As far as I can tell the patch is compatible with Python 2.4.
Comment 3 Tais P. Hansen 2008-02-12 20:28:20 UTC
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?
Comment 4 Santiago M. Mola (RETIRED) gentoo-dev 2008-02-12 20:32:31 UTC
Yep, it comes probably from 2.3. In 2.4 both encodings.exceptions.LookupError and LookupError exists.
Comment 5 Arne Babenhauserheide 2008-02-12 21:31:15 UTC
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)? 
Comment 6 mephinet 2008-03-10 09:33:16 UTC
(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"
$ python2.4 -c "print LookupError"
$ python2.5 -c "print LookupError"
<type 'exceptions.LookupError'>

So please, go ahead.
Comment 7 Hanno Böck gentoo-dev 2008-04-06 13:40:12 UTC
committed -r2 with patch
Comment 8 Arne Babenhauserheide 2008-04-07 06:47:02 UTC
Many thanks!