Skip to content
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

Do not use the absolute path to cache wheel extensions. #226

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

stewartmiles
Copy link

Wheel names can be long and paths to mounted wheels can be long. Previously util.path_to_cache_dir() was unconditionally building cache paths using the absolute path of the cache directory joined with the absolute path to a wheel being mounted. This makes it very easy to generate in huge paths that exceed the maximum path length (MAX_PATH) on Windows machines without the
registry change to support long paths.

A user-wide shared location for cached data is potentially easy enough to poison with incorrect extensions, so using the absolute path of a wheel being mounted to cache extensions doesn't seem to add any more protection and results in very long hard to read paths that can exceed Windows path limits in out of the box installations.

Fixes #224

Wheel names can be long and paths to mounted wheels can be long.
Previously `util.path_to_cache_dir()` was unconditionally building
cache paths using the absolute path of the cache directory joined
with the absolute path to a wheel being mounted. This makes it very
easy to generate in huge paths that exceed the maximum path length
(MAX_PATH) on Windows machines without the
[registry change](https://learn.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation?tabs=registry)
to support long paths.

A user-wide shared location for cached data is potentially easy enough
to poison with incorrect extensions, so using the absolute path of a
wheel being mounted to cache extensions doesn't seem to add any more
protection and results in very long hard to read paths that can exceed
Windows path limits in out of the box installations.

Fixes pypa#224
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Reduce temporary path length of extensions extracted from wheels
1 participant