Modify

#10616 closed defect (worksforme)

UndefinedError: None has no member named "get"

Reported by: camel_flying@… Owned by: coderanger
Priority: high Component: PyDotOrgTheme
Severity: normal Keywords: genshi templates
Cc: olemis Trac Release: 0.12

Description

How to Reproduce

While doing a GET operation on /admin/theme/custom, Trac issued an internal error.

(please provide additional details here)

Request parameters:

{'cat_id': u'theme', 'panel_id': u'custom', 'path_info': None}

User agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.4 (KHTML, like Gecko) Chrome/22.0.1229.94 Safari/537.4

System Information

Trac 0.12.2
Babel 0.9.6
Docutils 0.7
Genshi 0.6
mod_python 3.3.1
psycopg2 2.4.2
Pygments 1.4
Python 2.7.2+ (default, Jul 20 2012, 22:32:25)
[GCC 4.6.1]
pytz 2010b
RPC 1.1.2-r12168
setuptools 0.6
Subversion 1.6.12 (r955767)
jQuery 1.4.2

Enabled Plugins

TracAccountManager 0.3.2
TracPyDotOrgTheme 2.0
TracReportManager 0.1
TracThemeEngine 2.0.1
TracTicketTemplate 0.7
TracTocMacro 11.0.0.3
TracWikiPrintPlugin 1.9.2
TracXMLRPC 1.1.2-r12168

Python Traceback

Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/Trac-0.12.2-py2.7.egg/trac/web/main.py", line 511, in _dispatch_request
    dispatcher.dispatch(req)
  File "/usr/local/lib/python2.7/dist-packages/Trac-0.12.2-py2.7.egg/trac/web/main.py", line 258, in dispatch
    content_type)
  File "/usr/local/lib/python2.7/dist-packages/Trac-0.12.2-py2.7.egg/trac/web/chrome.py", line 868, in render_template
    stream.render(method, doctype=doctype, out=buffer)
  File "/usr/lib/python2.7/dist-packages/genshi/core.py", line 183, in render
    return encode(generator, method=method, encoding=encoding, out=out)
  File "/usr/lib/python2.7/dist-packages/genshi/output.py", line 58, in encode
    for chunk in iterator:
  File "/usr/lib/python2.7/dist-packages/genshi/output.py", line 339, in __call__
    for kind, data, pos in stream:
  File "/usr/lib/python2.7/dist-packages/genshi/output.py", line 826, in __call__
    for kind, data, pos in stream:
  File "/usr/lib/python2.7/dist-packages/genshi/output.py", line 670, in __call__
    for kind, data, pos in stream:
  File "/usr/lib/python2.7/dist-packages/genshi/output.py", line 771, in __call__
    for kind, data, pos in chain(stream, [(None, None, None)]):
  File "/usr/lib/python2.7/dist-packages/genshi/output.py", line 586, in __call__
    for ev in stream:
  File "/usr/lib/python2.7/dist-packages/genshi/core.py", line 288, in _ensure
    for event in stream:
  File "/usr/lib/python2.7/dist-packages/genshi/core.py", line 288, in _ensure
    for event in stream:
  File "/usr/local/lib/python2.7/dist-packages/Trac-0.12.2-py2.7.egg/trac/web/chrome.py", line 981, in _strip_accesskeys
    for kind, data, pos in stream:
  File "/usr/lib/python2.7/dist-packages/genshi/core.py", line 288, in _ensure
    for event in stream:
  File "/usr/local/lib/python2.7/dist-packages/Trac-0.12.2-py2.7.egg/trac/web/chrome.py", line 970, in _generate
    for kind, data, pos in stream:
  File "/usr/lib/python2.7/dist-packages/genshi/core.py", line 288, in _ensure
    for event in stream:
  File "/usr/lib/python2.7/dist-packages/genshi/template/base.py", line 605, in _include
    for event in stream:
  File "/usr/lib/python2.7/dist-packages/genshi/template/markup.py", line 362, in _match
    content = list(content)
  File "/usr/lib/python2.7/dist-packages/genshi/template/base.py", line 605, in _include
    for event in stream:
  File "/usr/lib/python2.7/dist-packages/genshi/template/markup.py", line 316, in _strip
    event = next()
  File "/usr/lib/python2.7/dist-packages/genshi/template/base.py", line 545, in _flatten
    for kind, data, pos in stream:
  File "/usr/lib/python2.7/dist-packages/genshi/template/directives.py", line 359, in __call__
    iterable = _eval_expr(self.expr, ctxt, vars)
  File "/usr/lib/python2.7/dist-packages/genshi/template/base.py", line 277, in _eval_expr
    retval = expr.evaluate(ctxt)
  File "/usr/lib/python2.7/dist-packages/genshi/template/eval.py", line 178, in evaluate
    return eval(self.code, _globals, {'__data__': data})
  File "/usr/local/lib/python2.7/dist-packages/TracThemeEngine-2.0.1-py2.7.egg/themeengine/templates/admin_theme_custom.html", line 19, in <Expression u"iter(current_theme.get('colors',()))">
    <py:for each="color in current_theme.get('colors',())">
  File "/usr/lib/python2.7/dist-packages/genshi/template/eval.py", line 277, in _die
    raise UndefinedError(self._name, self._owner)
UndefinedError: None has no member named "get"

Attachments (0)

Change History (4)

comment:1 follow-up: Changed 22 months ago by rjollos

  • Component changed from SELECT A HACK to PyDotOrgTheme
  • Owner set to coderanger

Could be a problem with ThemeEnginePlugin, but my first guess would be a problem with the PyDotOrgTheme. Both have the same maintainer, and he should be able to provide more info.

comment:2 in reply to: ↑ 1 Changed 22 months ago by rjollos

  • Cc olemis added

Replying to rjollos:

Both have the same maintainer, and he should be able to provide more info.

I was wrong about that, thinking that the PyDotOrgTheme belonged to olemis. Still, he is the best source to ask for help on this issue, so I've cc'ed him.

comment:3 Changed 22 months ago by olemis

  • Keywords genshi templates added
  • Priority changed from normal to high

I'll take a look at this issue . However before that happens I need you to please try PyTppThemePlugin and check if you notice a similar problem . Report the results back to us , please.

comment:4 Changed 17 months ago by rjollos

  • Resolution set to worksforme
  • Status changed from new to closed

I tried it out and don't find any issues with ThemeEnginePlugin 2.1.3 and the latest revision of PyDotOrgTheme. Please update your plugins, try again and reopen this ticket if you continue to have issues.

Add Comment

Modify Ticket

Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
Author


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

 
Note: See TracTickets for help on using tickets.