Edgewall Software
Modify

Opened 16 years ago

Closed 16 years ago

Last modified 15 years ago

#7834 closed defect (fixed)

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

Reported by: dna <dna@…> Owned by: Christian Boos
Priority: highest Milestone: 0.12
Component: general Version: devel
Severity: normal Keywords: i18n
Cc: Branch:
Release Notes:
API Changes:
Internal 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 (0)

Change History (8)

comment:1 by Christian Boos, 16 years ago

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 by dna <dna@…>, 16 years ago

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

comment:3 by Christian Boos, 16 years ago

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 by Christian Boos, 16 years ago

Keywords: i18n added
Resolution: fixed
Status: newclosed

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 by Christian Boos, 16 years ago

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

in reply to:  4 comment:6 by Christian Boos, 16 years ago

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 by Remy Blank, 16 years ago

Owner: set to Christian Boos

comment:8 by kinggoddard@…, 15 years ago

Priority: normalhighest

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

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Christian Boos.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Christian Boos to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.