Skip to content

Commit b9f074f

Browse files
add issue number to comments
1 parent 283df0a commit b9f074f

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Lib/tempfile.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -826,8 +826,8 @@ def resetperms(path):
826826
cls._rmtree(path, ignore_errors=ignore_errors)
827827
# PermissionError is raised on FreeBSD for directories
828828
except PermissionError:
829-
# On Windows, calling _rmtree again will raise
830-
# NotADirectoryError and mask the PermissionError.
829+
# bpo-43153: On Windows, calling _rmtree again will
830+
# raise NotADirectoryError and mask the PermissionError.
831831
# So we must re-raise the current PermissionError.
832832
if _os.name == 'nt' and not _os.path.isdir(path):
833833
if ignore_errors:

Lib/test/test_tempfile.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1465,7 +1465,7 @@ def test_explicit_cleanup_correct_error(self):
14651465
with tempfile.TemporaryDirectory() as working_dir:
14661466
temp_dir = self.do_create(dir=working_dir)
14671467
with open(os.path.join(temp_dir.name, "example.txt"), 'wb'):
1468-
# Used to raise NotADirectoryError on Windows.
1468+
# Used to raise NotADirectoryError on Windows. See bpo-43153.
14691469
with self.assertRaises(PermissionError):
14701470
temp_dir.cleanup()
14711471

0 commit comments

Comments
 (0)