summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorBrian Curtin <brian@python.org>2011-11-07 22:09:20 (GMT)
committerBrian Curtin <brian@python.org>2011-11-07 22:09:20 (GMT)
commit569b49432002a4750640c4b3883187796f2f5036 (patch)
treeac72250d790f11695d9aa8b30ec7c374359a60a2 /Lib
parent7ef53ef916453fc2d907ae783aa0bd5801aa5575 (diff)
downloadcpython-569b49432002a4750640c4b3883187796f2f5036.zip
cpython-569b49432002a4750640c4b3883187796f2f5036.tar.gz
cpython-569b49432002a4750640c4b3883187796f2f5036.tar.bz2
Fix #13327. utimensat now has the atime and mtime arguments set as optional,
defaulting to None like the other utimes family members. It now accepts keyword arguments because, unlike other other functions in the family, it has a `flags` value at the end of the argument list (which retains its 0 default).
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_posix.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/test/test_posix.py b/Lib/test/test_posix.py
index cb33477..cdd1108 100644
--- a/Lib/test/test_posix.py
+++ b/Lib/test/test_posix.py
@@ -815,11 +815,16 @@ class PosixTester(unittest.TestCase):
try:
now = time.time()
posix.utimensat(f, support.TESTFN, None, None)
+ posix.utimensat(f, support.TESTFN)
+ posix.utimensat(f, support.TESTFN, flags=os.AT_SYMLINK_NOFOLLOW)
self.assertRaises(TypeError, posix.utimensat, f, support.TESTFN, (None, None), (None, None))
self.assertRaises(TypeError, posix.utimensat, f, support.TESTFN, (now, 0), None)
self.assertRaises(TypeError, posix.utimensat, f, support.TESTFN, None, (now, 0))
posix.utimensat(f, support.TESTFN, (int(now), int((now - int(now)) * 1e9)),
(int(now), int((now - int(now)) * 1e9)))
+ posix.utimensat(dirfd=f, path=support.TESTFN,
+ atime=(int(now), int((now - int(now)) * 1e9)),
+ mtime=(int(now), int((now - int(now)) * 1e9)))
finally:
posix.close(f)