Opened 9 years ago

Closed 9 years ago

#10430 closed (wontfix)

Django fails to import cmemcached (with a "d" on the end)

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


Some python wrappers for libmemcached specify the package name "cmemcached" instead of "cmemcache." (ex. Currently django only tries to import "cmemcache" and "memcache" which results in an error if using a wrapper with a package name of "cmemcached"

As a suggestion, In django/core/cache/backends/, the import could look like the following to resolve this...

    import cmemcache as memcache
except ImportError:
        import cmemcached as memcache
    except ImportError:
            import memcache
            raise InvalidCacheBackendError("Memcached cache backend requires either the 'memcache' or 'cmemcache' library")

Change History (2)

comment:1 Changed 9 years ago by James Bennett

AFAIK we do this because the only memcached library we actually want to use is the Tummy one.

comment:2 Changed 9 years ago by Malcolm Tredinnick

Resolution: wontfix
Status: newclosed

Yes, this behaviour is intentional. The idea is not to try and import everything that might possible wrap memcached, since they won't all have the same API and that adds more and more testing burden to what we're supporting.

Maybe in the 1.2 timeframe you might like to make a pitch for why we should support some extra wrapper instead of, or in addition to (probably the latter) to what we have now, but the current imports shouldn't be changed at the moment.

Resolving as wontfix for now, since the current code is doing what's intended.

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