Fix test_access_denied in 3.5

This commit is contained in:
Berker Peksag 2016-09-17 16:20:55 +03:00
parent 0b4dc4846b
commit 9a1c91a10d
1 changed files with 2 additions and 1 deletions

View File

@ -440,7 +440,8 @@ class StatAttributeTests(unittest.TestCase):
# supports file ACLs.
fname = os.path.join(os.environ['TEMP'], self.fname)
self.addCleanup(support.unlink, fname)
create_file(fname, b'ABC')
with open(fname, 'xb', 0) as fp:
fp.write(b'ABC')
# Deny the right to [S]YNCHRONIZE on the file to
# force CreateFile to fail with ERROR_ACCESS_DENIED.
DETACHED_PROCESS = 8