Opened 15 years ago

Closed 15 years ago

Last modified 15 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: dev
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

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 15 years ago.
Proposed fix of the problem

Download all attachments as: .zip

Change History (3)

by Oldřich Jedlička, 15 years ago

Attachment: django-get_full_path.patch added

Proposed fix of the problem

comment:1 by Alex Gaynor, 15 years ago

Resolution: duplicate
Status: newclosed

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

comment:2 by Oldřich Jedlička, 15 years ago

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

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