Opened 8 years ago

Closed 7 years ago

#5308 closed (fixed)

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

Reported by: webjunkie Owned by: nobody
Component: Contrib apps Version: master
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: UI/UX:

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 webjunkie 7 years ago.

Download all attachments as: .zip

Change History (6)

Changed 7 years ago by webjunkie

comment:1 Changed 7 years ago by anonymous

  • Has patch set
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

comment:2 Changed 7 years ago by webjunkie

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

comment:3 Changed 7 years ago by webjunkie

  • Keywords sprintsept14 added

comment:4 Changed 7 years ago by webjunkie

  • Triage Stage changed from Unreviewed to Ready for checkin

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

comment:5 Changed 7 years ago by adrian

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

(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