-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Windows: Long filename detection #13346
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
What about a path with a few slashes in it? I vaguely remember that long paths and long names are treated differently. (Sorry, I'm a long way from the nearest Windows machine or I'd just check myself.) |
It turns out I do have long paths enabled (via the registry rather than group policy), sorry for the false report. The problem seen here is when the filename itself is 255 characters or longer, which does still occur on PyPI. >>> Path('a/'*300).mkdir(parents=True, exist_ok=True)
>>> Path('a/'*300 + 'a'*251 + '.txt').touch()
>>> Path('a/'*300 + 'a'*252 + '.txt').touch()
Traceback (most recent call last):
File "<input>", line 1, in <module>
File "...\Lib\pathlib\__init__.py", line 1010, in touch
fd = os.open(self, flags, mode)
OSError: [Errno 22] Invalid argument: 'a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\a\\aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.txt' |
Yeah, there are a few different errors that can occur due to long paths. But that particular one is due to a long segment, which is still limited even with the OS setting changed. You might want to look at the |
PRs are welcome :) |
Uh oh!
There was an error while loading. Please reload this page.
Re: https://discuss.python.org/t/pep-773-a-python-installation-manager-for-windows/77900/160
pip/src/pip/_internal/commands/install.py
Lines 777 to 791 in 24f4600
This gives exc as
OSError(22, 'Invalid argument')
, whereexc.errno == errno.EINVAL
, rather thanENOENT
.Python 3.13.2; Windows 11
A
The text was updated successfully, but these errors were encountered: