#3922 closed defect (fixed)
NameError: Variable "attachment" is not defined
| Reported by: | malawar | Owned by: | Christian Boos | 
|---|---|---|---|
| Priority: | high | Milestone: | 0.11 | 
| Component: | general | Version: | devel | 
| Severity: | major | Keywords: | |
| Cc: | Branch: | ||
| Release Notes: | |||
| API Changes: | |||
| Internal Changes: | |||
Description (last modified by )
Trying to delete a file attached to WikiStart, using the latest builds from svn for Trac and Genshi. < and > replaced with ( and )
How to Reproduce
While doing a GET operation on /attachment/wiki/WikiStart/Some Attached Document With Spaces.doc, Trac issued an internal error.
System Information
| Python |  2.4.4c0 (#1, Jul 30 2006, 15:39:57)[GCC 4.1.2 20060715 (prerelease) (Debian 4.1.1-9)] 
 | 
| Subversion |  1.3.2 
 | 
| SQLite |  3.3.7 
 | 
| pysqlite |  2.3.2 
 | 
Python Traceback
Traceback (most recent call last):
  File "/usr/lib/python2.4/site-packages/trac/web/main.py", line 366, in dispatch_request
    dispatcher.dispatch(req)
  File "/usr/lib/python2.4/site-packages/trac/web/main.py", line 237, in dispatch
    content_type, data)
  File "/usr/lib/python2.4/site-packages/trac/web/chrome.py", line 469, in render_response
    return stream.render(method, doctype=doctype)
  File "/usr/lib/python2.4/site-packages/genshi/core.py", line 146, in render
    output = u''.join(list(generator))
  File "/usr/lib/python2.4/site-packages/genshi/output.py", line 200, in __call__
    for kind, data, pos in stream:
  File "/usr/lib/python2.4/site-packages/genshi/output.py", line 488, in __call__
    for kind, data, pos in chain(stream, [(None, None, None)]):
  File "/usr/lib/python2.4/site-packages/genshi/output.py", line 436, in __call__
    for kind, data, pos in stream:
  File "/usr/lib/python2.4/site-packages/genshi/core.py", line 207, in _ensure
    for event in stream:
  File "/usr/lib/python2.4/site-packages/genshi/filters.py", line 313, in __call__
    for kind, data, pos in stream:
  File "/usr/lib/python2.4/site-packages/genshi/template.py", line 1128, in _match
    content = list(content)
  File "/usr/lib/python2.4/site-packages/genshi/filters.py", line 313, in __call__
    for kind, data, pos in stream:
  File "/usr/lib/python2.4/site-packages/genshi/template.py", line 1103, in _match
    for kind, data, pos in stream:
  File "/usr/lib/python2.4/site-packages/genshi/template.py", line 1092, in _strip
    kind, data, pos = stream.next()
  File "/usr/lib/python2.4/site-packages/genshi/template.py", line 912, in _eval
    result = data.evaluate(ctxt)
  File "/usr/lib/python2.4/site-packages/genshi/eval.py", line 95, in evaluate
    {'data': data})
  File "/usr/share/trac/templates/attachment.html", line 55, in (Expression u"attachment.filename")
    (h1)(a href="$parent.href")$parent.name(/a): $attachment.filename(/h1)
  File "/usr/lib/python2.4/site-packages/genshi/eval.py", line 199, in _lookup_attr
    obj.throw()
  File "/usr/lib/python2.4/site-packages/genshi/eval.py", line 152, in throw
    raise NameError('Variable "%s" is not defined' % self.name)
NameError: Variable "attachment" is not defined
Attachments (0)
Change History (7)
comment:1 by , 19 years ago
| Priority: | normal → high | 
|---|---|
| Severity: | normal → major | 
follow-up: 6 comment:3 by , 19 years ago
| Description: | modified (diff) | 
|---|---|
| Milestone: | → 0.11 | 
| Owner: | changed from to | 
(in automated reports, the Python version info is sometimes output in multiple lines (on Unix), so we should either remove the newlines in the second column of System Information [3897] or respect the newline by introducing a [[br]] [3898])
Concerning < and > replaced with ( and ) , does that mean that the "<" and ">" in the traceback don't get escaped? I'll check.
Now, back to the topic: I couldn't reproduce the problem… attachments (even with spaces in the file name) seem to work fine for me (attaching, previewing, getting them in plaintext, etc.), can you describe more precisely what operations you were doing?
comment:6 by , 19 years ago
Replying to cboos:
(in automated reports, the Python version info is sometimes output in multiple lines (on Unix), so we should either remove the newlines in the second column of System Information [3897] or respect the newline by introducing a
[[br]][3898])Concerning < and > replaced with ( and ) , does that mean that the "<" and ">" in the traceback don't get escaped? I'll check.
Now, back to the topic: I couldn't reproduce the problem… attachments (even with spaces in the file name) seem to work fine for me (attaching, previewing, getting them in plaintext, etc.), can you describe more precisely what operations you were doing?
at the time of posting <a href= was blocked as spam, hence () instead of ≠.



  
raised priority and severity on the ticket.