Edgewall Software
Modify

Ticket #7834 (closed defect: fixed)

Opened 3 years ago

Last modified 2 years ago

AttributeError: 'function' object has no attribute 'ugettext'

Reported by: dna <dna@…> Owned by: cboos
Priority: highest Milestone: 0.12
Component: general Version: devel
Severity: normal Keywords: i18n
Cc:
Release Notes:
API Changes:

Description

Hello,

i installed Trac (Trac-0.12dev_r7715-py2.5.egg) via

sudo easy_install http://svn.edgewall.org/repos/trac/trunk

and Genshi (Genshi 0.6dev-r960) via

sudo easy_install Genshi

and Babel (Babel-0.9.4-py2.5.egg) via

sudo easy_install Babel

Now i got the following error:

Traceback (most recent call last):
  File "/usr/lib/python2.5/site-packages/Trac-0.12dev_r7715-py2.5.egg/trac/web/api.py", line 375, in send_error
    data, 'text/html')
  File "/usr/lib/python2.5/site-packages/Trac-0.12dev_r7715-py2.5.egg/trac/web/chrome.py", line 741, in render_template
    return stream.render(method, doctype=doctype)
  File "/usr/lib/python2.5/site-packages/Genshi-0.6dev_r960-py2.5-linux-i686.egg/genshi/core.py", line 179, in render
    return encode(generator, method=method, encoding=encoding, out=out)
  File "/usr/lib/python2.5/site-packages/Genshi-0.6dev_r960-py2.5-linux-i686.egg/genshi/output.py", line 56, in encode
    return _encode(u''.join(list(iterator)))
  File "/usr/lib/python2.5/site-packages/Genshi-0.6dev_r960-py2.5-linux-i686.egg/genshi/output.py", line 307, in __call__
    for kind, data, pos in stream:
  File "/usr/lib/python2.5/site-packages/Genshi-0.6dev_r960-py2.5-linux-i686.egg/genshi/output.py", line 749, in __call__
    for kind, data, pos in stream:
  File "/usr/lib/python2.5/site-packages/Genshi-0.6dev_r960-py2.5-linux-i686.egg/genshi/output.py", line 588, in __call__
    for kind, data, pos in stream:
  File "/usr/lib/python2.5/site-packages/Genshi-0.6dev_r960-py2.5-linux-i686.egg/genshi/output.py", line 694, in __call__
    for kind, data, pos in chain(stream, [(None, None, None)]):
  File "/usr/lib/python2.5/site-packages/Genshi-0.6dev_r960-py2.5-linux-i686.egg/genshi/output.py", line 528, in __call__
    for ev in stream:
  File "/usr/lib/python2.5/site-packages/Genshi-0.6dev_r960-py2.5-linux-i686.egg/genshi/core.py", line 267, in _ensure
    event = stream.next()
  File "/usr/lib/python2.5/site-packages/Genshi-0.6dev_r960-py2.5-linux-i686.egg/genshi/core.py", line 267, in _ensure
    event = stream.next()
  File "/usr/lib/python2.5/site-packages/Trac-0.12dev_r7715-py2.5.egg/trac/web/chrome.py", line 793, in _strip_accesskeys
    for kind, data, pos in stream:
  File "/usr/lib/python2.5/site-packages/Genshi-0.6dev_r960-py2.5-linux-i686.egg/genshi/core.py", line 267, in _ensure
    event = stream.next()
  File "/usr/lib/python2.5/site-packages/Trac-0.12dev_r7715-py2.5.egg/trac/web/chrome.py", line 782, in _generate
    for kind, data, pos in stream:
  File "/usr/lib/python2.5/site-packages/Genshi-0.6dev_r960-py2.5-linux-i686.egg/genshi/template/base.py", line 603, in _include
    for event in stream:
  File "/usr/lib/python2.5/site-packages/Genshi-0.6dev_r960-py2.5-linux-i686.egg/genshi/template/markup.py", line 330, in _match
    for event in stream:
  File "/usr/lib/python2.5/site-packages/Genshi-0.6dev_r960-py2.5-linux-i686.egg/genshi/template/base.py", line 577, in _exec
    for event in stream:
  File "/usr/lib/python2.5/site-packages/Genshi-0.6dev_r960-py2.5-linux-i686.egg/genshi/template/base.py", line 530, in _eval
    for kind, data, pos in stream:
  File "/usr/lib/python2.5/site-packages/Genshi-0.6dev_r960-py2.5-linux-i686.egg/genshi/template/base.py", line 585, in _flatten
    for event in stream:
  File "/usr/lib/python2.5/site-packages/Genshi-0.6dev_r960-py2.5-linux-i686.egg/genshi/filters/i18n.py", line 181, in __call__
    gettext = self.translate.ugettext
AttributeError: 'function' object has no attribute 'ugettext'

On Ubuntu 8.10 with Apache + mod_python.

Attachments

Change History

comment:1 Changed 3 years ago by cboos

For proper operation on trunk you need Genshi:branches/experimental/advanced-i18n, from svn (svn co http://svn.edgewall.org/repos/genshi/branches/experimental/advanced-i18n).

I'll try to see if we can make it at least not break with genshi trunk (it should not break with 0.5.1, it seems).

comment:2 Changed 3 years ago by dna <dna@…>

Ok, thanks. This solves the exception.
But the localization still does not work.

comment:3 Changed 3 years ago by cboos

Ok, Isee, it's the Babel + Genshi trunk combination which doesn't work.
Babel + Genshi 0.5.1 won't work either.

For making the localization work, you should compile the catalogs. Have a look at 0.12/TracInstall, near the end of that section.

comment:4 follow-up: Changed 3 years ago by cboos

  • Keywords i18n added
  • Resolution set to fixed
  • Status changed from new to closed

Fixed in [7725] (actually only one fix here - the various refers to what I've split in another patch [7726]).

The following configurations work now:

  • Genshi trunk 0.6dev-r960
  • Genshi advanced-i18n 0.6dev-r966
  • Genshi 0.5.1

Each tested with and without Babel 0.9.4 (earlier versions of Babel not tested, but also not supported).

comment:5 Changed 3 years ago by cboos

I should have kept all fixes together as [7726] is also needed for Genshi trunk / no Babel.

comment:6 in reply to: ↑ 4 Changed 3 years ago by cboos

The following configurations work now:

  • Genshi 0.5.1

That is, on pages that didn't involve using the i18n:msg attribute in templates.
See #7728.

comment:7 Changed 3 years ago by rblank

  • Owner set to cboos

comment:8 Changed 2 years ago by kinggoddard@…

  • Priority changed from normal to highest

Still broekn!

Traceback (most recent call last):

File "/usr/local/bin/tracd", line 5, in <module>

from pkg_resources import load_entry_point

File "/usr/lib/python2.6/dist-packages/pkg_resources.py", line 2566, in <module>

parse_requirements(requires), Environment()

File "/usr/lib/python2.6/dist-packages/pkg_resources.py", line 524, in resolve

raise DistributionNotFound?(req) # XXX put more info here

pkg_resources.DistributionNotFound?: Genshi>=0.6dev

View

Add a comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
The resolution will be deleted. Next status will be 'reopened'
to The owner will be changed from cboos. Next status will be 'closed'
Author


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

 
Note: See TracTickets for help on using tickets.