[New-bugs-announce] [issue46490] Add "follow_symlinks=False" support for "os.utime()" on Windows

Delgan report at bugs.python.org
Sun Jan 23 13:41:48 EST 2022

New submission from Delgan <delgan.py at gmail.com>:


Currently, trying to use "os.utime(path, timestamps, follow_symlinks=False)" raises a exception on Windows: "NotImplementedError: utime: follow_symlinks unavailable on this platform".

Looking at the Win32 API it seems possible to open a symbolic link by specifying the "FILE_FLAG_OPEN_REPARSE_POINT" flag: https://docs.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-createfilew#symbolic-link-behavior

Do you think it would be possible to update "os.utime()" implementation and optionally pass the flag here: https://github.com/python/cpython/blob/ca78130d7eb5265759697639e42487ec6d0a4caf/Modules/posixmodule.c#L5516 ?

components: Library (Lib)
messages: 411399
nosy: Delgan
priority: normal
severity: normal
status: open
title: Add "follow_symlinks=False" support for "os.utime()" on Windows
versions: Python 3.11

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list