summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorSteve Dower <steve.dower@python.org>2019-09-04 21:42:54 (GMT)
committerGitHub <noreply@github.com>2019-09-04 21:42:54 (GMT)
commit772ec0fad57412daa53d16d7019b6b2fe6e94942 (patch)
tree29643e09afda8b8f31bc85db1d9b58b0427aeab4 /Lib/test
parent60bd1f88f21073965a444c8b39c4202d015da5d6 (diff)
downloadcpython-772ec0fad57412daa53d16d7019b6b2fe6e94942.zip
cpython-772ec0fad57412daa53d16d7019b6b2fe6e94942.tar.gz
cpython-772ec0fad57412daa53d16d7019b6b2fe6e94942.tar.bz2
bpo-38030: Fix os.stat failures on block devices on Windows (GH-15681)
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_os.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/test/test_os.py b/Lib/test/test_os.py
index 440cd6c..8ff0296 100644
--- a/Lib/test/test_os.py
+++ b/Lib/test/test_os.py
@@ -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):