We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4d30686 commit 17a5f42Copy full SHA for 17a5f42
diskcache/core.py
@@ -1703,9 +1703,6 @@ def peek(
1703
except IOError:
1704
# Key was deleted before we could retrieve result.
1705
continue
1706
- finally:
1707
- if name is not None:
1708
- self._disk.remove(name)
1709
break
1710
1711
if expire_time and tag:
tests/test_deque.py
@@ -302,3 +302,13 @@ def test_rotate_indexerror_negative(deque):
302
303
with mock.patch.object(deque, '_cache', cache):
304
deque.rotate(-1)
305
+
306
307
+def test_peek(deque):
308
+ value = b'x' * 100_000
309
+ deque.append(value)
310
+ assert len(deque) == 1
311
+ assert deque.peek() == value
312
313
314
0 commit comments