Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions memcache.py
Original file line number Diff line number Diff line change
Expand Up @@ -895,6 +895,9 @@ def set_multi(self, mapping, time=0, key_prefix='', min_compress_len=0,
server_keys, prefixed_to_orig_key = self._map_and_prefix_keys(
six.iterkeys(mapping), key_prefix)

mapping = dict([(k[1] if type(k) is tuple else k, v)
for k, v in six.iteritems(mapping)])

# send out all requests on each server before reading anything
dead_servers = []
notstored = [] # original keys.
Expand Down
4 changes: 2 additions & 2 deletions tests/test_setmulti.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,11 @@ def tearDown(self):
socket.socket = self.old_socket

def test_Socket_Disconnect(self):
mapping = {'foo': 'FOO', 'bar': 'BAR'}
mapping = {'foo': 'FOO', 'bar': 'BAR', (0, 'foobar'): 'FOOBAR'}
with captured_stderr() as log:
bad_keys = self.mc.set_multi(mapping)
self.assertIn('connection closed in readline().', log.getvalue())
self.assertEqual(sorted(bad_keys), ['bar', 'foo'])
self.assertEqual(sorted(bad_keys), ['bar', 'foo', 'foobar'])
if DEBUG:
print('set_multi({0!r}) -> {1!r}'.format(mapping, bad_keys))

Expand Down