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 arno-cs, benjamin.peterson, eryksun, serhiy.storchaka, sonderblade
Date 2019-04-27.16:26:25
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1556382385.42.0.700736477966.issue1776160@roundup.psfhosted.org>
In-reply-to
Content
In Windows 7, FindFirstFileA uses a per-thread static buffer to decode the input bytes path to Unicode. This buffer limits the length to 259 characters (MAX_PATH - 1), even if a "\\?\" device path is used. Windows 8+ uses a dynamic buffer, but I don't see the point of switching to a  dynamic buffer on our side given Windows 7 is still so widely used and the documentation still requires Unicode for long "\\?\" paths. 

Ideally, I think 2.7 should raise the same exception as 3.5 does in this case [1]. For example:

    >>> os.listdir(long_bytes_path)
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    ValueError: listdir: path too long for Windows

[1]: https://github.com/python/cpython/blob/v3.5.7/Modules/posixmodule.c#L928
History
Date User Action Args
2019-04-27 16:26:25eryksunsetrecipients: + eryksun, sonderblade, benjamin.peterson, serhiy.storchaka, arno-cs
2019-04-27 16:26:25eryksunsetmessageid: <1556382385.42.0.700736477966.issue1776160@roundup.psfhosted.org>
2019-04-27 16:26:25eryksunlinkissue1776160 messages
2019-04-27 16:26:25eryksuncreate