Skip to content

Commit 1cf777f

Browse files
committed
[3.11] pythongh-91387: Fix tarfile test on WASI (pythonGH-93984)
WASI's rmdir() syscall does not like the trailing slash. (cherry picked from commit dd78aae) Co-authored-by: Christian Heimes <[email protected]>
1 parent f6d777c commit 1cf777f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Lib/test/test_tarfile.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1031,7 +1031,7 @@ def test_longname_directory(self):
10311031
os.mkdir(longdir)
10321032
tar.add(longdir)
10331033
finally:
1034-
os.rmdir(longdir)
1034+
os.rmdir(longdir.rstrip("/"))
10351035
with tarfile.open(tmpname) as tar:
10361036
self.assertIsNotNone(tar.getmember(longdir))
10371037
self.assertIsNotNone(tar.getmember(longdir.removesuffix('/')))

0 commit comments

Comments
 (0)