mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
bpo-38030: Fix os.stat failures on block devices on Windows (GH-15681)
This commit is contained in:
parent
60bd1f88f2
commit
772ec0fad5
3 changed files with 22 additions and 6 deletions
|
@ -591,6 +591,14 @@ class StatAttributeTests(unittest.TestCase):
|
|||
result = os.stat(fname)
|
||||
self.assertNotEqual(result.st_size, 0)
|
||||
|
||||
@unittest.skipUnless(sys.platform == "win32", "Win32 specific tests")
|
||||
def test_stat_block_device(self):
|
||||
# bpo-38030: os.stat fails for block devices
|
||||
# Test a filename like "//./C:"
|
||||
fname = "//./" + os.path.splitdrive(os.getcwd())[0]
|
||||
result = os.stat(fname)
|
||||
self.assertEqual(result.st_mode, stat.S_IFBLK)
|
||||
|
||||
|
||||
class UtimeTests(unittest.TestCase):
|
||||
def setUp(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue