Code

Opened 5 years ago

Closed 5 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:

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")


Attachments (0)

Change History (2)

comment:1 Changed 5 years ago by ubernostrum

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

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

comment:2 Changed 5 years ago by mtredinnick

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

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.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.