Modify

Opened 9 years ago

Closed 9 years ago

#12580 closed defect (fixed)

AttributeError: 'NoneType' object has no attribute 'negotiate'

Reported by: johnt888@… Owned by: Franz
Priority: normal Component: MailPlugin
Severity: normal Keywords:
Cc: Trac Release: 1.0

Description (last modified by Ryan J Ollos)

Hi -

Just installed the latest 0.4.3 and got the following message:

AttributeError: 'NoneType' object has no attribute 'negotiate'

==============================================================

Python Traceback

Most recent call last: File "/hds/eda/virtualenv/trac/sles10/venv/lib/python2.7/site-packages/Trac-1.0-py2.7.egg/trac/web/main.py",
line 497, in _dispatch_request  

File "/hds/eda/virtualenv/trac/sles10/venv/lib/python2.7/site-packages/Trac-1.0-py2.7.egg/trac/web/main.py",
line 233, in dispatch  

File "/hds/eda/virtualenv/trac/sles10/venv/lib/python2.7/site-packages/Trac-1.0-py2.7.egg/trac/web/chrome.py",
line 968, in render_template  

File "/hds/eda/virtualenv/trac/sles10/venv/lib/python2.7/site-packages/Genshi-0.7-py2.7-linux-x86_64.egg/genshi/core.py",
line 133, in __or__  

File "/hds/eda/virtualenv/trac/sles10/venv/lib/python2.7/site-packages/Trac-1.0-py2.7.egg/trac/web/chrome.py",
line 1147, in inner  

File "build/bdist.linux-x86_64/egg/xmail/XMailEMailModule.py",
line 61, in filter_stream 

Attachments (0)

Change History (8)

comment:1 Changed 9 years ago by Ryan J Ollos

Description: modified (diff)

comment:2 Changed 9 years ago by Ryan J Ollos

It looks like Babel is required for this plugin: mailplugin/trunk/xmail/XMailEMailModule.py@14670:61#L52. It would be a good idea to include install_requires = ['Babel'] in setup.py, or else make Babel optional.

Side note: there is a transitive import from trac.prefs.web_ui import Locale. Instead, you should use from trac.util.translation import Locale: browser:tags/trac-1.0.9/trac/prefs/web_ui.py@:25#L17. There are no guarantees that trac.prefs.web_ui will continue to import Locale in the future.

Last edited 9 years ago by Ryan J Ollos (previous) (diff)

comment:3 Changed 9 years ago by anonymous

Thanks for quick help!

If we only use "en", could you advise the proper way modify the file?

self._locale_string = Locale.negotiate(preferred, available, sep='-')
Last edited 9 years ago by Ryan J Ollos (previous) (diff)

comment:4 Changed 9 years ago by johnt888@…

updated to the correct email instead of anonymous ...

comment:5 Changed 9 years ago by Ryan J Ollos

At mailplugin/trunk/xmail/XMailEMailModule.py@14670:53#L52:

if not self._TimerIsStillAlive():

->

if not self._TimerIsStillAlive() and Locale:

There could also be issues elsewhere in the code, I haven't looked closely.

comment:6 Changed 9 years ago by johnt888@…

thanks, sounds working with the modification so far.

comment:7 Changed 9 years ago by Ryan J Ollos

In 15082:

0.4.3: Replace transitive import with direct import

Refs #12580.

comment:8 Changed 9 years ago by Ryan J Ollos

Resolution: fixed
Status: newclosed

In 15083:

0.4.3: Fix error when babel is not installed

Fixes #12580.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Franz.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.