Author: Philip Jenvey <[email protected]>
Branch: py3k
Changeset: r84647:db0737b2163f
Date: 2016-05-23 16:46 -0700
http://bitbucket.org/pypy/pypy/changeset/db0737b2163f/

Log:    o utilize lutimes to fix follow_symlinks=False on osx o fix
        utime(None) on osx

diff --git a/pypy/module/posix/interp_posix.py 
b/pypy/module/posix/interp_posix.py
--- a/pypy/module/posix/interp_posix.py
+++ b/pypy/module/posix/interp_posix.py
@@ -1449,7 +1449,18 @@
             raise wrap_oserror(space, e)
 
     if not follow_symlinks:
-        raise argument_unavailable(space, "utime", "follow_symlinks")
+        if not rposix.HAVE_LUTIMES:
+            raise argument_unavailable(space, "utime", "follow_symlinks")
+        path_b = path.as_bytes
+        if path_b is None:
+            raise oefmt(space.w_NotImplementedError,
+                        "utime: unsupported value for 'path'")
+        try:
+            rposix.lutimes(path_b, (atime_s, atime_ns))
+            return
+        except OSError as e:
+            # see comment above
+            raise wrap_oserror(space, e)
 
     if not space.is_w(w_ns, space.w_None):
         raise oefmt(space.w_NotImplementedError,
@@ -1457,6 +1468,7 @@
     if now:
         try:
             call_rposix(utime_now, path, None)
+            return
         except OSError as e:
             # see comment above
             raise wrap_oserror(space, e)
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to