5 ms·
Because like industrial waste, Windows exports problems to other systems. 1. Windows has an absurdly short maximum path length of 260 characters. 2. On Window
by MereInterest 2y ago
Because like industrial waste, Windows exports problems to other systems.
1. Windows has an absurdly short maximum path length of 260 characters.
2. On Windows, moving files to a temporary directory can fail, if the temporary directory has a longer prefix than the original path.
3. When uninstalling, the python utility "pip" first collects files into a temporary directory, then deletes that temporary directory.
4. To avoid running into MAX_PATH limits, pip doesn't use a normal temp directory. Instead, it makes a temporary directory adjacent to the directory it is removing. (https://github.com/pypa/pip/pull/6029 https://github.com/pypa/pip/pull/6029)
5. If pip is interrupted while uninstalling, the adjacent temp directory is never deleted.
So, in order to work around a Windows-only problem, pip stopped using standard file locations, creating a new problem that only existed due to the workaround. And then I'm left trying to figure out why I'm running out of disk space.
- pompino 2y agohttps://www.cvedetails.com/top-50-products.php https://www.cvedetails.com/top-50-products.php Yeah, I don't see Windows in the top 5.
- mike_hearn 2y agoThe MAX_PATH limit is annoying legacy backwards compatible stuff, but can be avoided by prefixing paths with \\?\ before passing them into the Windows API. This is something that languages/runtimes with more effort put into portability already handle for you: https://github.com/openjdk/jdk/blob/master/src/java.base/windows/classes/sun/nio/fs/WindowsPath.java#L184 https://github.com/openjdk/jdk/blob/master/src/java.base/win... If Python doesn't do this it's just because the sort of people who write Python don't care about Windows enough to fix it.