Opened 9 years ago

Closed 9 years ago

#5557 closed (fixed)

The cache_page decorator fails on urls containing spaces

Reported by: eriks@… Owned by: jacob
Component: Core (Cache system) Version: master
Severity: Keywords: cache_page
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:


Memcache raises an exception when a key contains a space. The cache_page decorator does not escape the url of the page causing a server error.
The included patch wraps the use of request.path with a call to uri_to_iri()

Attachments (1)

django-utils-cache-py.patch (1.8 KB) - added by eriks@… 9 years ago.
Proposed patch

Download all attachments as: .zip

Change History (5)

Changed 9 years ago by eriks@…

Proposed patch

comment:1 Changed 9 years ago by aaloy <aaloy@…>

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

This error also occurs when memcached tries to caché an url item that gives 404 error. Django tries to generate a key with the prefix, the url and the error message. obrint la imatge /home/aaloy/wor/apsl/media/promociones/2006/12/04/2-foto.jpg

comment:2 Changed 9 years ago by ubernostrum

  • Triage Stage changed from Unreviewed to Accepted

We've run into this a couple times at World Online, and used various workarounds. It'd be nice to solve it once and for all in Django's caching system.

comment:3 Changed 9 years ago by jacob

  • Owner changed from nobody to jacob
  • Status changed from new to assigned

comment:4 Changed 9 years ago by jacob

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

(In [6435]) Fixed #5557: URLs are now properly escaped in the cache_page decorator. Thanks, eriks.

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