This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author eryksun
Recipients eryksun, pablogsal, vstinner, zach.ware
Date 2019-07-10.04:30:47
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1562733047.78.0.0117719880349.issue37528@roundup.psfhosted.org>
In-reply-to
Content
If you want to harden the test for Windows, you could transform TEMPDIR
into an extended path. os.path._getfinalpathname always returns an extended path. For example:

    >>> os.path._getfinalpathname('C:/Temp')
    '\\\\?\\C:\\Temp'

    >>> os.path._getfinalpathname('//localhost/C$/Temp')
    '\\\\?\\UNC\\localhost\\C$\\Temp'

> windows.RtlAreLongPathsEnabled: <function not available>
> 
> RtlAreLongPathsEnabled() is not available on Windows 8.1. I don't 
> know if long paths support is enabled or not on this buildbot (I 
> guess that no, it isn't).

Normalized long paths are implemented in Windows 10 1607 and later. Previous versions do not have RtlAreLongPathsEnabled and cannot support normalized long paths. RtlAreLongPathsEnabled() will be true if, at process startup, the "LongPathsEnabled" policy is enabled in the registry and the application manifest claims to be "longPathAware". 

In all supported versions of Windows, long paths are supported by most filesystem functions if we use an extended path, i.e. a fully-qualified Unicode path that starts with the \\?\ prefix. This path type is not normalized in a create or open context, so it can only use backslash as the path separator, not forward slash. Also, the process working directory does not allow extended paths, so when using extended paths we have to manage our own working directory and manually resolve relative paths, including "." and ".." components (e.g. by calling GetFullPathNameW).
History
Date User Action Args
2019-07-10 04:30:47eryksunsetrecipients: + eryksun, vstinner, zach.ware, pablogsal
2019-07-10 04:30:47eryksunsetmessageid: <1562733047.78.0.0117719880349.issue37528@roundup.psfhosted.org>
2019-07-10 04:30:47eryksunlinkissue37528 messages
2019-07-10 04:30:47eryksuncreate