Modify

Opened 11 years ago

Closed 11 years ago

Last modified 10 years ago

#11408 closed defect (cantfix)

Still AttributeError: NullTranslationsBabel instance has no attribute 'isactive'

Reported by: power_zhy Owned by: Steffen Hoffmann
Priority: normal Component: TagsPlugin
Severity: normal Keywords:
Cc: Trac Release: 1.0

Description

Description

I have met this problem several days earlier and after search here ticket:10903#comment:5 was found, following which the problem was solved, everything seems good.

But when I try to add the Tags Plugin (http://trac-hacks.org/wiki/TagsPlugin) to my trac, the same error occurred again, with the same traceback. (as tags 0.6 has a problem which cannot upgrade the trac env using trac-admin tool, after google all said using 0.7dev instead.)

Another thing, when connecting to my trac, my browser requires a file called common/js/messages/zh_Hans_CN.js, which was not exist, (but zh_CN.js is exist there.) I'm not sure if this information helps a little. When I set the language in perferences menu to English (United States), this do not happen but the AttributeError still exist.

Sorry for my poor English, Thanks!

How to Reproduce

While doing a GET operation on /tags, Trac issued an internal error.

Request parameters:

{'ticket': 'on', 'wiki': 'on'}

User agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:25.0) Gecko/20100101 Firefox/25.0

System Information

Trac 1.0.1
Trac 1.0.1
Babel 1.3-20131111
Docutils 0.11
Genshi 0.7 (without speedups)
Pygments 1.6
pysqlite 2.6.0
Python 2.7.5 (default, Sep 6 2013, 09:55:21)
[GCC 4.8.1 20130725 (prerelease)]
Python 2.7.5 (default, Sep 6 2013, 09:55:21)
[GCC 4.8.1 20130725 (prerelease)]
pytz 2013.8
pytz 2013.8
setuptools 1.3
setuptools 1.3
SQLite 3.8.1
jQuery 1.7.2

Enabled Plugins

TracAccountManager 0.4.3
TracTags 0.7dev

Python Traceback

Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/trac/web/main.py", line 497, in _dispatch_request
    dispatcher.dispatch(req)
  File "/usr/lib/python2.7/site-packages/trac/web/main.py", line 214, in dispatch
    resp = chosen_handler.process_request(req)
  File "build/bdist.linux-x86_64/egg/tractags/web_ui.py", line 101, in process_request
    data = dict(page_title=_("Tags"), checked_realms=checked_realms)
  File "/usr/lib/python2.7/site-packages/trac/util/translation.py", line 290, in <lambda>
    return lambda *args, **kw: _functions[symbol](domain, *args, **kw)
  File "/usr/lib/python2.7/site-packages/trac/util/translation.py", line 202, in dgettext
    if not self.isactive:
  File "/usr/lib/python2.7/site-packages/trac/util/translation.py", line 190, in __getattr__
    return getattr(self.active, name)
AttributeError: NullTranslationsBabel instance has no attribute 'isactive'

Attachments (0)

Change History (6)

comment:1 Changed 11 years ago by Steffen Hoffmann

Resolution: cantfix
Status: newclosed

It is true, that the call originates from a translation helper function inside TagsPlugin code (_("Tags")). But that's all, nothing suspicious at this stage.

The AttributeError indicates, that Trac was unsuccessful to bind any translations (catalogs), so a functionally very degraded compat object (NullTranslationsBabel) is the only thing called - and fails. You may argue that it shouldn't, and you may be right.

But there's absolutely nothing we could in the plugin code. You can only not use translations to not encounter the problems with you local installation. I might be Babel installed after, not before Trac, something about the gettext version in your system ... all speculation. But I bet you'll find out much more with Trac log level set to 'DEBUG' and then looking at the messages at Trac environment (re)initialization. The messages you see there typically direct you to the underlying problem.

Hope this helps a bit. My general recommendation is identical to the writing in the red box on-top of our new ticket page: Go ask at the mailing-list first. It is for your own good: Many more of us developers and maintainers will be reached. Just asserting a problem with this plugin did not so much. Anyway, good luck, and that you will enjoy Trac for your business as I do.

comment:3 Changed 11 years ago by power_zhy

Thanks, I just won't troubling the mailing-list as I'm not sure whether it's my own mistake, as this problem has been discussed here many times.

Just now, I downgrade the babel back to 0.9.6 and everything return to normal ...

Thanks again to your rapid reply ~

comment:4 Changed 11 years ago by Ryan J Ollos

There are a few issues that prevent using Babel 1.3 with released versions of Trac. I think trac:#11258 is the most relevant to the issues discussed here. Trac 1.0.2 will likely add support for Babel 1.3.

comment:5 in reply to:  3 Changed 11 years ago by Steffen Hoffmann

Replying to power_zhy:

Thanks, I just won't troubling the mailing-list as I'm not sure whether it's my own mistake, as this problem has been discussed here many times.

The more you doubt, the more you should actually use the mailing-list first. It is better than putting the burden on one or a few developers/maintainers.

Just now, I downgrade the babel back to 0.9.6 and everything return to normal ...

You're welcome. Nice, that it works for you now.

comment:6 Changed 10 years ago by anonymous

excuse me, but hos to downgrade the babel. im realy new to this, i mean trac, etc

comment:7 in reply to:  6 Changed 10 years ago by Ryan J Ollos

Replying to anonymous:

excuse me, but hos to downgrade the babel. im realy new to this, i mean trac, etc

That depends, foremost on whether you installed Babel using your OS package manager or setuptools. If you installed using setuptools, you can just delete the package directory under site-packages and reinstall using easy_install babel==0.9.6. If you have additional questions, please ask on the trac:MailingList.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Steffen Hoffmann.
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.