Skip to content

Commit 4556a74

Browse files
committed
Add lock for thread safety
1 parent 516fe12 commit 4556a74

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Lib/zipfile/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1894,7 +1894,8 @@ def remove(self, zinfo_or_arcname):
18941894
# get the info object
18951895
zinfo = self.getinfo(zinfo_or_arcname)
18961896

1897-
return self._remove_members({zinfo})
1897+
with self._lock:
1898+
return self._remove_members({zinfo})
18981899

18991900
@classmethod
19001901
def _sanitize_windows_name(cls, arcname, pathsep):

0 commit comments

Comments
 (0)