Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#12186 closed (duplicate)

HttpResponseRedirect(request.get_full_path()) fails with UnicodeEncodeError for international URL

Reported by: Oldřich Jedlička Owned by: nobody
Component: Uncategorized Version: master
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:


The problem is in get_full_path() when the path component contains unicode data. The path (unicode) cannot be used in the HttpResponseRedirect. The iri_to_uri should be used for the whole string I think. The simplest example that triggers the problem is this (when the URL contains international characters)

  def view(request):
    return HttpResponseRedirect(request.get_full_path())

Attachments (1)

django-get_full_path.patch (1.5 KB) - added by Oldřich Jedlička 9 years ago.
Proposed fix of the problem

Download all attachments as: .zip

Change History (3)

Changed 9 years ago by Oldřich Jedlička

Attachment: django-get_full_path.patch added

Proposed fix of the problem

comment:1 Changed 9 years ago by Alex Gaynor

Resolution: duplicate
Status: newclosed

Dupe of ##11522. Please search trac before filing a new ticket.

comment:2 Changed 9 years ago by Oldřich Jedlička

Sorry, I've searched for get_full_path, not for UnicodeEncodeError.

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