#1224 Web search page doesn't like unicode results
Closed: Fixed 5 years ago by mikem. Opened 5 years ago by mikem.

If a search result (e.g. a package name) contains a unicode character, then the web ui errors if it appears in the results:

 KeyError: u'\xb8'

Traceback (most recent call last):
  File "/usr/share/koji-web/scripts/wsgi_publisher.py", line 392, in handle_request
    result = func(environ, **data)
  File "/usr/share/koji-web/scripts/index.py", line 2289, in search
    return _genHTML(environ, 'searchresults.chtml')
  File "/usr/share/koji-web/lib/kojiweb/util.py", line 147, in _genHTML
    return tmpl_inst.respond().encode('utf-8', 'replace')
  File "searchresults_chtml.py", line 197, in respond
  File "/usr/lib64/python2.7/urllib.py", line 1298, in quote
    return ''.join(map(quoter, s))
KeyError: u'\xb8'

It appears that the searchresults template is url quoting the name field of the result in case the infoURL format string uses it. However, it doesn't look like we ever actually use the name field for any of those, so this might be an easy fix.


Metadata Update from @tkopecek:
- Issue set to the milestone: 1.18

5 years ago

Login to comment on this ticket.

Metadata
Related Pull Requests
  • #1281 Merged 5 years ago