Ticket #17810: 17810-catch-all.patch

File 17810-catch-all.patch, 1.6 KB (added by Aymeric Augustin, 12 years ago)
  • django/contrib/sessions/backends/cached_db.py

     
    2424    def load(self):
    2525        try:
    2626            data = cache.get(self.cache_key, None)
    27         except Exception, e:
    28             e_type = str(type(e))
    29             if e_type != "<class 'memcache.MemcachedKeyLengthError'>":
    30                 raise e
     27        except Exception:
     28            # Some backends (e.g. memcache) raise an exception on invalid
     29            # cache keys. If this happens, reset the session. See #17810.
    3130            data = None
    3231        if data is None:
    3332            data = super(SessionStore, self).load()
  • django/contrib/sessions/backends/cache.py

     
    1919    def load(self):
    2020        try:
    2121            session_data = self._cache.get(self.cache_key, None)
    22         except Exception, e:
    23             e_type = str(type(e))
    24             if e_type != "<class 'memcache.MemcachedKeyLengthError'>":
    25                 raise e
     22        except Exception:
     23            # Some backends (e.g. memcache) raise an exception on invalid
     24            # cache keys. If this happens, reset the session. See #17810.
    2625            session_data = None
    2726        if session_data is not None:
    2827            return session_data
Back to Top