From: Christian Heimes Date: Sat, 18 Jun 2022 17:55:48 +0000 (+0200) Subject: gh-91387: Fix tarfile test on WASI (GH-93984) X-Git-Tag: v3.12.0a1~1210 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=dd78aae34bc3c0fcf14b2e7be64e08246ee277cc;p=thirdparty%2FPython%2Fcpython.git gh-91387: Fix tarfile test on WASI (GH-93984) WASI's rmdir() syscall does not like the trailing slash. --- diff --git a/Lib/test/test_tarfile.py b/Lib/test/test_tarfile.py index f1aed5ccc6b7..e0389c5dc474 100644 --- a/Lib/test/test_tarfile.py +++ b/Lib/test/test_tarfile.py @@ -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('/')))