[Python-checkins] gh-91387: Fix tarfile test on WASI (GH-93984)

ethanfurman webhook-mailer at python.org
Sat Jun 18 13:56:00 EDT 2022


https://github.com/python/cpython/commit/dd78aae34bc3c0fcf14b2e7be64e08246ee277cc
commit: dd78aae34bc3c0fcf14b2e7be64e08246ee277cc
branch: main
author: Christian Heimes <christian at python.org>
committer: ethanfurman <ethan at stoneleaf.us>
date: 2022-06-18T10:55:48-07:00
summary:

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

WASI's rmdir() syscall does not like the trailing slash.

files:
M Lib/test/test_tarfile.py

diff --git a/Lib/test/test_tarfile.py b/Lib/test/test_tarfile.py
index f1aed5ccc6b76..e0389c5dc474f 100644
--- a/Lib/test/test_tarfile.py
+++ b/Lib/test/test_tarfile.py
@@ -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('/')))



More information about the Python-checkins mailing list