Added patch to fix: Dictionary changed size during iteration
Robinson Sathaseevan authored 4 years ago
Gianfranco Costamagna committed 3 years ago
6 | 6 |
* Bump debhelper from old 10 to 12.
|
7 | 7 |
* Set debhelper-compat version in Build-Depends.
|
8 | 8 |
* Set upstream metadata fields: Bug-Database, Repository.
|
|
9 |
|
|
10 |
[ Robinson Sathaseevan ]
|
|
11 |
* Add debian/patches/fix-dictionary-changed-size-during-iteration.patch:
|
|
12 |
- Issue caused by switching to python3 where .keys() on a dictionary
|
|
13 |
no longer returns a copy of the keys (Closes: #885914)
|
9 | 14 |
|
10 | 15 |
-- Ondřej Nový <onovy@debian.org> Mon, 01 Oct 2018 09:38:41 +0200
|
11 | 16 |
|
|
0 |
Description: Fix RuntimeError: dictionary changed size during iteration
|
|
1 |
It is fixed upstream but no new release includes it yet.
|
|
2 |
Origin: upstream, https://github.com/s3tools/s3cmd/pull/1070/commits/ee5e617c8787d39367f9b66aadee533bad346b43
|
|
3 |
Bug: https://github.com/s3tools/s3cmd/issues/945
|
|
4 |
Forwarded: not-needed
|
|
5 |
Author: Robinson Sathaseevan <robinson@sathas.com>
|
|
6 |
Last-Update: 2020-04-02
|
|
7 |
--- a/S3/HashCache.py
|
|
8 |
+++ b/S3/HashCache.py
|
|
9 |
@@ -31,9 +31,9 @@
|
|
10 |
return d['md5']
|
|
11 |
|
|
12 |
def mark_all_for_purge(self):
|
|
13 |
- for d in self.inodes.keys():
|
|
14 |
- for i in self.inodes[d].keys():
|
|
15 |
- for c in self.inodes[d][i].keys():
|
|
16 |
+ for d in tuple(self.inodes):
|
|
17 |
+ for i in tuple(self.inodes[d]):
|
|
18 |
+ for c in tuple(self.inodes[d][i]):
|
|
19 |
self.inodes[d][i][c]['purge'] = True
|
|
20 |
|
|
21 |
def unmark_for_purge(self, dev, inode, mtime, size):
|
|
22 |
@@ -45,9 +45,9 @@
|
|
23 |
del self.inodes[dev][inode][mtime]['purge']
|
|
24 |
|
|
25 |
def purge(self):
|
|
26 |
- for d in self.inodes.keys():
|
|
27 |
- for i in self.inodes[d].keys():
|
|
28 |
- for m in self.inodes[d][i].keys():
|
|
29 |
+ for d in tuple(self.inodes):
|
|
30 |
+ for i in tuple(self.inodes[d]):
|
|
31 |
+ for m in tuple(self.inodes[d][i]):
|
|
32 |
if 'purge' in self.inodes[d][i][m]:
|
|
33 |
del self.inodes[d][i]
|
|
34 |
break
|
|
0 |
fix-dictionary-changed-size-during-iteration.patch
|