8000 gh-114435: Allow test_stat_inaccessible_file() to have matching ino/d… · python/cpython@d91ddff · GitHub
[go: up one dir, main page]

Skip to content

Commit d91ddff

Browse files
authored
gh-114435: Allow test_stat_inaccessible_file() to have matching ino/dev (GH-114571)
This may occur if Windows allows reading stat information from a file even if the current user does not have access.
1 parent 102569d commit d91ddff

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

Lib/test/test_os.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3129,10 +3129,9 @@ def cleanup():
31293129
if support.verbose:
31303130
print(" without access:", stat2)
31313131

3132-
# We cannot get st_dev/st_ino, so ensure those are 0 or else our test
3133-
# is not set up correctly
3134-
self.assertEqual(0, stat2.st_dev)
3135-
self.assertEqual(0, stat2.st_ino)
3132+
# We may not get st_dev/st_ino, so ensure those are 0 or match
3133+
self.assertIn(stat2.st_dev, (0, stat1.st_dev))
3134+
self.assertIn(stat2.st_ino, (0, stat1.st_ino))
31363135

31373136
# st_mode and st_size should match (for a normal file, at least)
31383137
self.assertEqual(stat1.st_mode, stat2.st_mode)

0 commit comments

Comments
 (0)
0