Opened 9 years ago

Closed 6 years ago

#6129 closed (fixed)

"url" template-tag incorrectly encodes tilde (~) character in urls

Reported by: moe Owned by: PJCrosier
Component: Template system Version: master
Severity: Keywords:
Cc: Triage Stage: Design decision needed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:


The "url" template-tag encodes the tilde (~) character in urls
although it is a legal ("unreserved") URL character since
1995, cf. RFC2396.

RFC2396 (1995):
RFC3986 (2005):

This causes uglyness in the adressbar when a django app
wants to support the common http://server/~username/ URL-style.

Django should stick to the RFC and only encode characters
that must be encoded.

Attachments (1)

6129.django.utils.encoding.diff (415 bytes) - added by PJCrosier 9 years ago.
Fix to leave tildes alone

Download all attachments as: .zip

Change History (5)

Changed 9 years ago by PJCrosier

Fix to leave tildes alone

comment:1 Changed 9 years ago by PJCrosier

  • Has patch set
  • Needs documentation unset
  • Needs tests unset
  • Owner changed from nobody to PJCrosier
  • Patch needs improvement unset
  • Status changed from new to assigned

I've attached a simple patch.. is it really this simple or am I missing something, would be good to get a professional opinion :D

comment:2 Changed 9 years ago by PJCrosier

  • Status changed from assigned to new

comment:3 Changed 9 years ago by SmileyChris

  • Keywords flapdoodle removed
  • Triage Stage changed from Unreviewed to Design decision needed

It does look that you're right.

comment:4 Changed 6 years ago by mtredinnick

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

This is definitely a safe change to make and was already fixed in r12066 (along with a couple of other characters).

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