Message340998
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 |
|
Date |
User |
Action |
Args |
2019-04-27 16:26:25 | eryksun | set | recipients:
+ eryksun, sonderblade, benjamin.peterson, serhiy.storchaka, arno-cs |
2019-04-27 16:26:25 | eryksun | set | messageid: <1556382385.42.0.700736477966.issue1776160@roundup.psfhosted.org> |
2019-04-27 16:26:25 | eryksun | link | issue1776160 messages |
2019-04-27 16:26:25 | eryksun | create | |
|