Code

Opened 12 months ago

Closed 12 months ago

Last modified 12 months ago

#20722 closed Bug (fixed)

MemcachedCache backend get_many does not work on Python 3

Reported by: timo 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 timo 12 months ago.

Download all attachments as: .zip

Change History (5)

Changed 12 months ago by timo

comment:1 Changed 12 months ago by aaugustin

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

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

Otherwise, yes, please commit and backport.

comment:2 Changed 12 months ago by Tim Graham <timograham@…>

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

In 3c736207a37840109f16f004c343c77b5ee389b6:

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

comment:3 Changed 12 months ago by Tim Graham <timograham@…>

In 7788c7189036bcd78692aaae1dd4260d7a7563bf:

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

Backport of 3c736207a3 from master

comment:4 Changed 12 months ago by Tim Graham <timograham@…>

In 7bbf6971329d7fdd5343895c7e8c292f7e64d95e:

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

Backport of 3c736207a3 from master

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.