Modify ↓
Opened 9 years ago
Closed 9 years ago
#12580 closed defect (fixed)
AttributeError: 'NoneType' object has no attribute 'negotiate'
Reported by: | Owned by: | Franz | |
---|---|---|---|
Priority: | normal | Component: | MailPlugin |
Severity: | normal | Keywords: | |
Cc: | Trac Release: | 1.0 |
Description (last modified by )
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
Description: | modified (diff) |
---|
comment:3 Changed 9 years ago by
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='-')
comment:5 Changed 9 years ago by
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.
Note: See
TracTickets for help on using
tickets.
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']
insetup.py
, or else make Babel optional.Side note: there is a transitive import
from trac.prefs.web_ui import Locale
. Instead, you should usefrom trac.util.translation import Locale
: browser:tags/trac-1.0.9/trac/prefs/web_ui.py@:25#L17. There are no guarantees thattrac.prefs.web_ui
will continue to importLocale
in the future.