Closed Bug 551991 Opened 14 years ago Closed 14 years ago

Redirect in search with unicode values crashes

Categories

(addons.mozilla.org Graveyard :: API, defect)

defect
Not set
normal

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: jbalogh, Assigned: davedash)

References

()

Details

(Whiteboard: [z][r=clouserw])

I don't think urls are supposed to have unicode, but it looks like we'll have to deal with this.

Traceback (most recent call last):

 File "/data/virtualenvs_preview/zamboni/lib/python2.6/site-packages/django/core/handlers/base.py", line 101, in get_response
   response = callback(request, *callback_args, **callback_kwargs)

 File "/data/amo_python/www/preview/zamboni/apps/api/views.py", line 191, in redirect_view
   (api.CURRENT_VERSION, url))

 File "/data/virtualenvs_preview/zamboni/lib/python2.6/site-packages/django/http/__init__.py", line 444, in __init__
   self['Location'] = redirect_to

 File "/data/virtualenvs_preview/zamboni/lib/python2.6/site-packages/django/http/__init__.py", line 350, in __setitem__
   header, value = self._convert_to_ascii(header, value)

 File "/data/virtualenvs_preview/zamboni/lib/python2.6/site-packages/django/http/__init__.py", line 339, in _convert_to_ascii
   value = value.encode('us-ascii')

UnicodeEncodeError: 'ascii' codec can't encode characters in position 16-20: ordinal not in range(128), HTTP response headers must be in US-ASCII format
-> davedash.  We need this fixed before the API can go live.
Whiteboard: [z] → [z][r?clouserw][gh:davedash/api]
Status: NEW → ASSIGNED
Whiteboard: [z][r?clouserw][gh:davedash/api] → [z][r=clouserw][gh:davedash/api]
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
New failure: /he/firefox/api/1.2/search/für

Traceback (most recent call last):

 File "/data/virtualenvs_preview/zamboni/lib/python2.6/site-packages/django/core/handlers/base.py", line 101, in get_response
   response = callback(request, *callback_args, **callback_kwargs)

 File "/data/amo_python/www/preview/zamboni/apps/api/urls.py", line 9, in <lambda>
   class_view = lambda x: lambda *args, **kwargs: x()(*args, **kwargs)

 File "/data/amo_python/www/preview/zamboni/apps/api/views.py", line 76, in __call__
   return self.process_request(*args, **kwargs)

 File "/data/amo_python/www/preview/zamboni/apps/api/views.py", line 152, in process_request
   query = urllib.unquote(query.encode('ascii'))

UnicodeEncodeError: 'ascii' codec can't encode character u'\xfc' in position 1: ordinal not in range(128)
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Whiteboard: [z][r=clouserw][gh:davedash/api] → [z]
Status: REOPENED → ASSIGNED
Whiteboard: [z] → [z][r?clouserw][gh:davedash/api]
(In reply to comment #2)
> New failure: /he/firefox/api/1.2/search/für

Oh, somebody wants to sign up for German classes ;)
Fixed in: http://github.com/jbalogh/zamboni/commit/6bd85c43d93c183e58c20a4cacc02e7537c21acb
Status: ASSIGNED → RESOLVED
Closed: 14 years ago14 years ago
Resolution: --- → FIXED
Whiteboard: [z][r?clouserw][gh:davedash/api] → [z][r=clouserw]
Product: addons.mozilla.org → addons.mozilla.org Graveyard
You need to log in before you can comment on or make changes to this bug.