Modify

Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#3157 closed defect (fixed)

Causes error when trying to view a ticket

Reported by: anonymous Owned by: k0s
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:
    1. <py:if test="field">
    2. <py:choose test="">
    3. <py:when test="'rendered' in field">${field.rendered}</py:when>
    4. <py:otherwise>
    5. <py:if test="ticket[field.name]">
    6. <a href="${query_link(field.name, ticket[field.name])}">
    7. ${ticket[field.name]}
    8. </a>
    9. </py:if>
    10. </py:otherwise>
    11. </py:choose>
    Local variables: Name Value data [{'field': {'name': 'priority', 'type': 'select', 'value': u'major', ...
  • File "/usr/lib/python2.5/site-packages/AutoQuery-0.1.2-py2.5.egg/autoquery/autoquery.py", line 81, in <lambda> Code fragment:
    1. (Since 0.11)
    2. """
    3. if template == 'ticket.html':
    4. query = self.env.href() + '/query?%s=%s' + self.query_args
    5. dataquery_link? = lambda x, y: query % (x, urllib.quote_plus(y))
    6. template = 'autoquery_ticket.html'
    7. return (template, data, content_type)
    Local variables: Name Value query u'/trac/mediaplan/query?%s=%s&order=priority' x 'priority' y u'\u0432\u0430\u0436\u043d\u044b\u0439'
  • File "/usr/lib/python2.5/urllib.py", line 1213, in quote_plus Code fragment:
    1. def quote_plus(s, safe = ):
    2. """Quote the query fragment of a URL; replacing ' ' with '+'"""
    3. if ' ' in s:
    4. s = quote(s, safe + ' ')
    5. return s.replace(' ', '+')
    6. return quote(s, safe)
    7. def urlencode(query,doseq=0):
    8. """Encode a sequence of two-element tuples or dictionary into a URL query string.
    9. 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:
    1. safe_map = {}
    2. for i in range(256):
    3. c = chr(i)
    4. safe_map[c] = (c in safe) and c or ('%%%02X' % i)
    5. _safemaps[cachekey] = safe_map
    6. res = map(safe_map.getitem, s)
    7. return .join(res)
    8. def quote_plus(s, safe = ):
    9. """Quote the query fragment of a URL; replacing ' ' with '+'"""
    10. 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: Changed 6 years ago by k0s

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

(In [3816]) if urllib fails, just pass on the query as is. could have space issues that may also need fixing; fixes #3157

comment:2 in reply to: ↑ 1 Changed 6 years ago by k0s

Replying to k0s:

(In [3816]) if urllib fails, just pass on the query as is. could have space issues that may also need fixing; fixes #3157

this is really a bug in urllib but this should be a decent workaround

comment:3 Changed 6 years ago by raa

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

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.