]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-91387: Fix tarfile test on WASI (GH-93984)
authorChristian Heimes <christian@python.org>
Sat, 18 Jun 2022 17:55:48 +0000 (19:55 +0200)
committerGitHub <noreply@github.com>
Sat, 18 Jun 2022 17:55:48 +0000 (10:55 -0700)
WASI's rmdir() syscall does not like the trailing slash.

Lib/test/test_tarfile.py

index f1aed5ccc6b76b6b946c9a0f0d6ecc9a398e8568..e0389c5dc474f5e5141449a1d7b1f8b12924a61c 100644 (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('/')))