Kaydet (Commit) d4e3bb3d authored tarafından Martin v. Löwis's avatar Martin v. Löwis

Port access, chmod, parts of getcwdu, mkdir, and utime to direct Win32 API.

üst ce5933f5
......@@ -327,6 +327,10 @@ def mkdtemp(suffix="", prefix=template, dir=None):
try:
_os.mkdir(file, 0700)
return file
except WindowsError, e:
if e.errno == 183: # ERROR_ALREADY_EXISTS
continue # try again
raise
except OSError, e:
if e.errno == _errno.EEXIST:
continue # try again
......
......@@ -375,6 +375,18 @@ class Win32ErrorTests(unittest.TestCase):
def test_chdir(self):
self.assertRaises(WindowsError, os.chdir, test_support.TESTFN)
def test_mkdir(self):
self.assertRaises(WindowsError, os.chdir, test_support.TESTFN)
def test_utime(self):
self.assertRaises(WindowsError, os.utime, test_support.TESTFN, None)
def test_access(self):
self.assertRaises(WindowsError, os.utime, test_support.TESTFN, 0)
def test_chmod(self):
self.assertRaises(WindowsError, os.utime, test_support.TESTFN, 0)
if sys.platform != 'win32':
class Win32ErrorTests(unittest.TestCase):
pass
......
......@@ -67,8 +67,8 @@ Core and builtins
Extension Modules
-----------------
- Use Win32 API to implement os.{chdir,rename,rmdir,remove}. As a result,
these functions now raise WindowsError instead of OSError.
- Use Win32 API to implement os.{access,chdir,chmod,mkdir,remove,rename,rmdir,utime}.
As a result, these functions now raise WindowsError instead of OSError.
- Calling Tk_Init twice is refused if the first call failed as that
may deadlock.
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment