Skip to content

Commit 608b7f6

Browse files
committed
gh-98758: Skip permission-denied test on Windows
os.chmod() on Windows can only toggle the read-only attribute, not actually restrict read access, so chmod(path, 0) followed by open(path, 'rb') still succeeds there -- the test's premise doesn't hold on that platform.
1 parent 80bbc49 commit 608b7f6

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

Lib/test/test_shutil.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2277,6 +2277,9 @@ def test_unpack_archive_unknown_format_fifo(self):
22772277

22782278
@unittest.skipIf(sys.platform[:6] == 'cygwin',
22792279
"This test can't be run on Cygwin (issue #1071513).")
2280+
@unittest.skipIf(sys.platform == 'win32',
2281+
"os.chmod() cannot make a file unreadable on Windows, "
2282+
"only read-only (see the os.chmod() docs)")
22802283
@os_helper.skip_if_dac_override
22812284
@os_helper.skip_unless_working_chmod
22822285
def test_unpack_archive_permission_denied(self):

0 commit comments

Comments
 (0)