#3157 closed defect (fixed)
Causes error when trying to view a ticket
Reported by: | anonymous | Owned by: | Jeff Hammel |
---|---|---|---|
Priority: | normal | Component: | AutoQueryPlugin |
Severity: | blocker | Keywords: | |
Cc: | Trac Release: | 0.11 |
Description
Trac detected an internal error:
KeyError: u'\u0432'
Python Traceback Most recent call last:
- File "/usr/lib/python2.5/site-packages/AutoQuery-0.1.2-py2.5.egg/autoquery/templates/autoquery_ticket.html", line 167, in <Expression u'query_link(field.name, ticket[field.name])'>
Code fragment:
- <py:if test="field">
- <py:choose test="">
- <py:when test="'rendered' in field">${field.rendered}</py:when>
- <py:otherwise>
- <py:if test="ticket[field.name]">
- <a href="${query_link(field.name, ticket[field.name])}">
- ${ticket[field.name]}
- </a>
- </py:if>
- </py:otherwise>
- </py:choose>
- File "/usr/lib/python2.5/site-packages/AutoQuery-0.1.2-py2.5.egg/autoquery/autoquery.py", line 81, in <lambda>
Code fragment:
- (Since 0.11)
- """
- if template == 'ticket.html':
- query = self.env.href() + '/query?%s=%s' + self.query_args
- dataquery_link? = lambda x, y: query % (x, urllib.quote_plus(y))
- template = 'autoquery_ticket.html'
- return (template, data, content_type)
- File "/usr/lib/python2.5/urllib.py", line 1213, in quote_plus
Code fragment:
- def quote_plus(s, safe = ):
- """Quote the query fragment of a URL; replacing ' ' with '+'"""
- if ' ' in s:
- s = quote(s, safe + ' ')
- return s.replace(' ', '+')
- return quote(s, safe)
- def urlencode(query,doseq=0):
- """Encode a sequence of two-element tuples or dictionary into a URL query string.
- If any values in the query arg are sequences and doseq is true, each Local variables: Name Value s u'\u0432\u0430\u0436\u043d\u044b\u0439' safe
- File "/usr/lib/python2.5/urllib.py", line 1205, in quote
Code fragment:
- safe_map = {}
- for i in range(256):
- c = chr(i)
- safe_map[c] = (c in safe) and c or ('%%%02X' % i)
- _safemaps[cachekey] = safe_map
- res = map(safe_map.getitem, s)
- return .join(res)
- def quote_plus(s, safe = ):
- """Quote the query fragment of a URL; replacing ' ' with '+'"""
- if ' ' in s: Local variables: Name Value cachekey (, 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_.-') s u'\u0432\u0430\u0436\u043d\u044b\u0439' safe safe_map {'\x00': '%00', '\x83': '%83', '\x04': '%04', '\x87': '%87', '\x08': ...
File "/usr/lib/python2.5/site-packages/AutoQuery-0.1.2-py2.5.egg/autoquery/templates/autoquery_ticket.html", line 167, in <Expression u'query_link(field.name, ticket[field.name])'>
<a href="${query_link(field.name, ticket[field.name])}">
File "/usr/lib/python2.5/site-packages/AutoQuery-0.1.2-py2.5.egg/autoquery/autoquery.py", line 81, in <lambda>
dataquery_link? = lambda x, y: query % (x, urllib.quote_plus(y))
File "/usr/lib/python2.5/urllib.py", line 1213, in quote_plus
return quote(s, safe)
File "/usr/lib/python2.5/urllib.py", line 1205, in quote
res = map(safe_map.getitem, s)
User Agent: Mozilla/5.0 (X11; U; Linux i686; ru; rv:1.8.1.14) Gecko/20080404 Iceweasel/2.0.0.14 (Debian-2.0.0.14-2) Trac: 0.11dev-r7184 Python: 2.5.2 (r252:60911, May 15 2008, 17:59:19) [GCC 4.3.1 20080501 (prerelease)] setuptools: 0.6c8 SQLite: 3.5.9 pysqlite: 2.4.1 Genshi: 0.5dev-r860 Pygments: 0.10 Subversion: 1.4.6 (r28521) jQuery: 1.2.3
Attachments (0)
Change History (3)
comment:1 follow-up: 2 Changed 17 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:2 Changed 17 years ago by
comment:3 Changed 17 years ago by
Thank you very much. I have updated the plugin and now there are no errors. However there is another small trouble. Please see ticket:3178
(In [3816]) if urllib fails, just pass on the query as is. could have space issues that may also need fixing; fixes #3157