Raise exception if trying to extract a member that doesn't exist
This commit is contained in:
parent
de7fe72cec
commit
dfc12ed79e
@ -319,6 +319,9 @@ class PackageAdapter:
|
||||
self._package.extractall(path=path)
|
||||
return self.get_names()
|
||||
|
||||
if missing_members := set(members) - set(self.get_names()):
|
||||
raise ValueError(f"Missing members: {missing_members}")
|
||||
|
||||
if isinstance(self._package, ZipFile):
|
||||
self._package.extractall(path=path, members=members)
|
||||
if isinstance(self._package, TarFile):
|
||||
|
Loading…
Reference in New Issue
Block a user