Opened 17 years ago

Closed 17 years ago

#5308 closed (fixed)

[Patch] Redirect from pages that need login and have Unicode URL causes error

Reported by: Julian Bez Owned by: nobody
Component: Contrib apps Version: dev
Severity: Keywords: unicode url login auth decorator checklogin redirect quote sprintsept14
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

How to repeat:

have a page that has encoded Unicode in URL, like http://www.example.com/gie%C3%9Fen/xyz/.
Make that page available to authenticated users only.
Try browsing to it when not logged in.

I get an error. On other pages, where there's a 'normal' URL, not.

Traceback (most recent call last):

 File "/usr/local/lib/python2.4/site-packages/django/core/handlers/base.py", line 77, in get_response
   response = callback(request, *callback_args, **callback_kwargs)

 File "/usr/local/lib/python2.4/site-packages/django/contrib/auth/decorators.py", line 18, in _checklogin
   return HttpResponseRedirect('%s?%s=%s' % (login_url, REDIRECT_FIELD_NAME, quote(request.get_full_path())))

 File "/usr/local/lib/python2.4/urllib.py", line 1117, in quote
   res = map(safe_map.__getitem__, s)

KeyError: u'\xdf'

Attachments (1)

decorators.py.patch (920 bytes ) - added by Julian Bez 17 years ago.

Download all attachments as: .zip

Change History (6)

by Julian Bez, 17 years ago

Attachment: decorators.py.patch added

comment:1 by anonymous, 17 years ago

Has patch: set

comment:2 by Julian Bez, 17 years ago

Summary: Redirect from pages that need login and have Unicode URL causes error[Patch] Redirect from pages that need login and have Unicode URL causes error

comment:3 by Julian Bez, 17 years ago

Keywords: sprintsept14 added

comment:4 by Julian Bez, 17 years ago

Triage Stage: UnreviewedReady for checkin

Make it now ready for checkin because I believe this patch solves it.

comment:5 by Adrian Holovaty, 17 years ago

Resolution: fixed
Status: newclosed

(In [6226]) Fixed #5308 -- Redirect from pages that need login and have Unicode URL no longer causes error. Thanks, webjunkie

Note: See TracTickets for help on using tickets.
Back to Top