tar/zip: use volume name as toplevel fallback

This commit is contained in:
ed 2023-04-23 20:55:34 +00:00
parent f5191973df
commit fdd6f3b4a6
3 changed files with 15 additions and 6 deletions

View file

@ -122,7 +122,7 @@ class TestHttpCli(unittest.TestCase):
tar = tarfile.open(fileobj=io.BytesIO(b)).getnames()
except:
tar = []
tar = [x[4:] if x.startswith("top/") else x for x in tar]
tar = [x.split("/", 1)[1] for x in tar]
tar = ["/".join([y for y in [top, durl, x] if y]) for x in tar]
tar = [[x] + self.can_rw(x) for x in tar]
tar_ok = [x[0] for x in tar if x[1]]