Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#12186 closed (duplicate)

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

Reported by: oldium 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 oldium 6 years ago.
Proposed fix of the problem

Download all attachments as: .zip

Change History (3)

Changed 6 years ago by oldium

Proposed fix of the problem

comment:1 Changed 6 years ago by Alex

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to duplicate
  • Status changed from new to closed

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

comment:2 Changed 6 years ago by oldium

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

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