Opened 16 years ago

Closed 16 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: no UI/UX: no

Description

Some python wrappers for libmemcached specify the package name "cmemcached" instead of "cmemcache." (ex. http://code.google.com/p/python-libmemcached/) 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/memcached.py, the import could look like the following to resolve this...

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


Change History (2)

comment:1 by James Bennett, 16 years ago

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

comment:2 by Malcolm Tredinnick, 16 years ago

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