Opened 10 years ago

Closed 10 years ago

#392 closed defect (fixed)

django sets up memcache incorrectly when arguments are given

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

Description

If your settings file is specifying a cache backend and giving arguments after the '?' you will see errors like this:

MemCache: 127.0.0.1:9999: connect: Name or service not known. Marking dead.

This is because the '' is not trimmed correctly when there is a '?' in CACHE_BACKEND. Here is a patch:

Index: django/core/cache.py
===================================================================
--- django/core/cache.py        (revision 544)
+++ django/core/cache.py        (working copy)
@@ -243,7 +243,7 @@
     qpos = rest.find('?')
     if qpos != -1:
         params = dict(parse_qsl(rest[qpos+1:]))
-        host = rest[:qpos]
+        host = rest[2:qpos]
     else:
         params = {}
     if host.endswith('/'):

Change History (1)

comment:1 Changed 10 years ago by adrian

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

Fixed in [598].

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