Skip to content

Commit

Permalink
[3.11] pythongh-91387: Fix tarfile test on WASI (pythonGH-93984)
Browse files Browse the repository at this point in the history
WASI's rmdir() syscall does not like the trailing slash.
(cherry picked from commit dd78aae)

Co-authored-by: Christian Heimes <christian@python.org>
  • Loading branch information
tiran committed Jun 21, 2022
1 parent f6d777c commit 1cf777f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Lib/test/test_tarfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -1031,7 +1031,7 @@ def test_longname_directory(self):
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('/')))
Expand Down

0 comments on commit 1cf777f

Please sign in to comment.