mirror of
https://github.com/python/cpython.git
synced 2025-11-25 04:34:37 +00:00
Bug #1686475: Support stat'ing open files on Windows again.
Will backport to 2.5.
This commit is contained in:
parent
80e8c998a2
commit
3bf573f918
3 changed files with 77 additions and 34 deletions
|
|
@ -240,6 +240,15 @@ class StatAttributeTests(unittest.TestCase):
|
|||
os.utime(self.fname, (t1, t1))
|
||||
self.assertEquals(os.stat(self.fname).st_mtime, t1)
|
||||
|
||||
def test_1686475(self):
|
||||
# Verify that an open file can be stat'ed
|
||||
try:
|
||||
os.stat(r"c:\pagefile.sys")
|
||||
except WindowsError, e:
|
||||
if e == 2: # file does not exist; cannot run test
|
||||
return
|
||||
self.fail("Could not stat pagefile.sys")
|
||||
|
||||
from test import mapping_tests
|
||||
|
||||
class EnvironTests(mapping_tests.BasicTestMappingProtocol):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue