Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#20722 closed Bug (fixed)

MemcachedCache backend get_many does not work on Python 3

Reported by: Tim Graham Owned by: nobody
Component: Core (Cache system) Version: 1.5
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

These two test failures are fixed with the attached patch. Should this be backported to 1.5.x?

======================================================================
ERROR: test_cache_versioning_get_set_many (cache.tests.MemcachedCacheTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/tim/code/django/tests/cache/tests.py", line 685, in test_cache_versioning_get_set_many
    self.assertEqual(self.cache.get_many(['ford1','arthur1']),
  File "/home/tim/code/django/django/core/cache/backends/memcached.py", line 95, in get_many
    _[m[k]] = v
KeyError: ':1:arthur1'

======================================================================
ERROR: test_get_many (cache.tests.MemcachedCacheTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/tim/code/django/tests/cache/tests.py", line 234, in test_get_many
    self.assertEqual(self.cache.get_many(['a', 'c', 'd']), {'a' : 'a', 'c' : 'c', 'd' : 'd'})
  File "/home/tim/code/django/django/core/cache/backends/memcached.py", line 95, in get_many
    _[m[k]] = v
KeyError: ':1:a'

Attachments (1)

20722.diff (593 bytes ) - added by Tim Graham 11 years ago.

Download all attachments as: .zip

Change History (5)

by Tim Graham, 11 years ago

Attachment: 20722.diff added

comment:1 by Aymeric Augustin, 11 years ago

I'd rather replace list(map(lambda ...))) with a list comprehension.

Otherwise, yes, please commit and backport.

comment:2 by Tim Graham <timograham@…>, 11 years ago

Resolution: fixed
Status: newclosed

In 3c736207a37840109f16f004c343c77b5ee389b6:

Fixed #20722 -- Fixed MemcachedCache backend get_many on Python 3.

comment:3 by Tim Graham <timograham@…>, 11 years ago

In 7788c7189036bcd78692aaae1dd4260d7a7563bf:

[1.6.x] Fixed #20722 -- Fixed MemcachedCache backend get_many on Python 3.

Backport of 3c736207a3 from master

comment:4 by Tim Graham <timograham@…>, 11 years ago

In 7bbf6971329d7fdd5343895c7e8c292f7e64d95e:

[1.5.x] Fixed #20722 -- Fixed MemcachedCache backend get_many on Python 3.

Backport of 3c736207a3 from master

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