Closed Bug 1289576 Opened 8 years ago Closed 8 years ago

Direct-search crashes given a unicode search string

Categories

(Webtools Graveyard :: DXR, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: erik, Assigned: ertugkeremoglu)

Details

(Whiteboard: easy python)

Type "readmé" into the search box and hit return:

Traceback (most recent call last):
  File "/venv/lib/python2.7/site-packages/flask/app.py", line 1836, in __call__
    return self.wsgi_app(environ, start_response)
  File "/venv/lib/python2.7/site-packages/flask/app.py", line 1820, in wsgi_app
    response = self.make_response(self.handle_exception(e))
  File "/venv/lib/python2.7/site-packages/flask/app.py", line 1403, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "/venv/lib/python2.7/site-packages/flask/app.py", line 1817, in wsgi_app
    response = self.full_dispatch_request()
  File "/venv/lib/python2.7/site-packages/flask/app.py", line 1477, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/venv/lib/python2.7/site-packages/flask/app.py", line 1381, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/venv/lib/python2.7/site-packages/flask/app.py", line 1475, in full_dispatch_request
    rv = self.dispatch_request()
  File "/venv/lib/python2.7/site-packages/flask/app.py", line 1461, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/home/dxr/dxr/dxr/app.py", line 143, in search
    return searcher(query, tree, query_text, offset, limit, config)
  File "/home/dxr/dxr/dxr/app.py", line 164, in _search_json
    result = query.direct_result()
  File "/home/dxr/dxr/dxr/query.py", line 189, in direct_result
    clause = searcher(term)
  File "/home/dxr/dxr/dxr/plugins/core.py", line 614, in direct_path
    return _path_trigram_filter(term['arg'], term['case_sensitive'])
  File "/home/dxr/dxr/dxr/plugins/core.py", line 569, in _path_trigram_filter
    regex_grammar.parse(regex.format(re.escape(path))),
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe9' in position 6: ordinal not in range(128)
Hello. Can you please assign this task to me? It will be my first contribution to Mozilla. : )
Assignee: nobody → ertugkeremoglu
Commit pushed to master at https://github.com/mozilla/dxr

https://github.com/mozilla/dxr/commit/6d89984e55661a2a7e3cdb02d0a809f7ae76804e
Fix direct-search crashes given a unicode search string. Fixes bug 1289576.
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Product: Webtools → Webtools Graveyard
You need to log in before you can comment on or make changes to this bug.