Modify

Opened 5 years ago

Last modified 4 years ago

#6069 new task

UndefinedError : Select not defined !

Reported by: anonymous Owned by: izzy
Priority: high Component: WikiLastModifiedPatch
Severity: blocker Keywords:
Cc: Trac Release: 0.11

Description

My TRAC does not support the 'select' command. This is a deal breaker ....

Is this an undocumented error or issue that is not on the installation instructions for this macro ?

<!-- Wiki Footer (last_modified info) -->

<div py:match="div[@id='content' and @class='wiki']" py:attrs="select('@*')">

${select('*')}

<div class="lastmodified">Last modified by ${format_author(page.author)}, ${format_datetime(page.time)} (${dateinfo(page.time)} ago)</div>

</div>

${select('*|text()')}

<div id="sitefooter"></div>

Attachments (0)

Change History (6)

comment:1 Changed 5 years ago by jayunit100@…

Not sure how to fix this any ideas ?

comment:2 Changed 5 years ago by izzy

Could you tell me the version of Trac you are using (i.e. the version of your Trac installation)? The select you are talking about is a feature of the Genshi template engine. You are sure you have Trac 0.11 in use, not 0.10 - as 0.10 has no Genshi support? With 0.11, the template engine in Trac was changed from ClearSilver to Genshi.

If your Trac is 0.10, there's nothing I can do for you. If it is 0.11, however, the complete error message could be helpful, including the error stack. In this case, the best is to copy this information (e.g. from your log file, or from the error on screen) to a text file, and attach it to the ticket. I will then see what I can do about it.

comment:3 Changed 5 years ago by jayunit100@…

The version is .11b. I will post the complete error message

comment:4 Changed 5 years ago by anonymous

Hi I'm sorry ---- Here is the error message. Please let me know what you think ! Thanks.....

Traceback (most recent call last):
  File "E:\Python25\lib\site-packages\trac\web\api.py", line 339, in send_error
    'text/html')
  File "E:\Python25\lib\site-packages\trac\web\chrome.py", line 683, in render_template
    return stream.render(method, doctype=doctype)
  File "E:\Python25\lib\site-packages\genshi\core.py", line 154, in render
    return encode(generator, method=method, encoding=encoding)
  File "E:\Python25\lib\site-packages\genshi\output.py", line 45, in encode
    output = u''.join(list(iterator))
  File "E:\Python25\lib\site-packages\genshi\output.py", line 274, in __call__
    for kind, data, pos in stream:
  File "E:\Python25\lib\site-packages\genshi\output.py", line 519, in __call__
    for kind, data, pos in stream:
  File "E:\Python25\lib\site-packages\genshi\output.py", line 679, in __call__
    for kind, data, pos in chain(stream, [(None, None, None)]):
  File "E:\Python25\lib\site-packages\genshi\output.py", line 459, in __call__
    for ev in stream:
  File "E:\Python25\lib\site-packages\genshi\core.py", line 212, in _ensure
    for event in stream:
  File "E:\Python25\lib\site-packages\genshi\core.py", line 212, in _ensure
    for event in stream:
  File "E:\Python25\lib\site-packages\trac\web\chrome.py", line 735, in _strip_accesskeys
    for kind, data, pos in stream:
  File "E:\Python25\lib\site-packages\genshi\core.py", line 212, in _ensure
    for event in stream:
  File "E:\Python25\lib\site-packages\trac\web\chrome.py", line 724, in _generate
    for kind, data, pos in stream:
  File "E:\Python25\lib\site-packages\genshi\template\markup.py", line 263, in _include
    for event in tmpl.generate(ctxt):
  File "E:\Python25\lib\site-packages\genshi\template\markup.py", line 263, in _include
    for event in tmpl.generate(ctxt):
  File "E:\Python25\lib\site-packages\genshi\template\markup.py", line 252, in _include
    for event in stream:
  File "E:\Python25\lib\site-packages\genshi\template\markup.py", line 297, in _match
    for event in stream:
  File "E:\Python25\lib\site-packages\genshi\template\markup.py", line 242, in _exec
    for event in stream:
  File "E:\Python25\lib\site-packages\genshi\template\base.py", line 421, in _eval
    result = data.evaluate(ctxt)
  File "E:\Python25\lib\site-packages\genshi\template\eval.py", line 136, in evaluate
    return eval(self.code, _globals, {'data': data})
  File "c:\tracprojects\connjur\templates\site.html", line 13, in <Expression u"select('*|text()')">
    ${select('*|text()')}
  File "E:\Python25\lib\site-packages\genshi\template\eval.py", line 236, in _die
    raise UndefinedError(self._name, self._owner)
UndefinedError: "select" not defined


comment:5 Changed 5 years ago by anonymous

I have the same issue, but only when i click on the button "Attach file"... I've deactivated this feature in the meanwhile...

comment:6 Changed 4 years ago by txcraig

This bit:

${select('*|text()')} 

needs to be inside the final </div> tag, not outside. I was seeing the same error and was able to get it working by moving the select just before the closing </div>

So the correct complete template is:

   <div py:match="div[@id='content' and @class='wiki']" py:attrs="select('@*')">
      <div class="lastmodified">Last modified by ${format_author(page.author)}, ${format_datetime(page.time)} (${dateinfo(page.time)} ago)
      </div>
      ${select('*|text()')}
   </div>

Add Comment

Modify Ticket

Action
as new The owner will remain izzy.
Author


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

 
Note: See TracTickets for help on using tickets.