gh-91387: Fix tarfile test on WASI (GH-93984)

WASI's rmdir() syscall does not like the trailing slash.
This commit is contained in:
Christian Heimes 2022-06-18 19:55:48 +02:00 committed by GitHub
parent fea1e9bc5c
commit dd78aae34b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1031,7 +1031,7 @@ class LongnameTest:
os.mkdir(longdir)
tar.add(longdir)
finally:
os.rmdir(longdir)
os.rmdir(longdir.rstrip("/"))
with tarfile.open(tmpname) as tar:
self.assertIsNotNone(tar.getmember(longdir))
self.assertIsNotNone(tar.getmember(longdir.removesuffix('/')))