ENH Support path length > MAX_PATH=260 on Windows#189
Merged
ogrisel merged 4 commits intojoblib:masterfrom Mar 11, 2025
Merged
Conversation
warn when the path length limit is reached
warn when the path length limit is reached
…long-path-windows
Contributor
Author
|
As discussed irl, setting up a test for this behavior seems overly complicated for such a very niche use case. Here's how it looks locally: In [1]: from threadpoolctl import threadpool_info
In [2]: threadpool_info()
Out[2]: []
In [3]: import numpy
In [4]: threadpool_info()
Out[4]:
[{'user_api': 'blas',
'internal_api': 'openblas',
'num_threads': 16,
'prefix': 'libscipy_openblas',
'filepath': 'C:\\Users\\J\\miniconda3\\envs\\joblib-dev\\Lib\\site-packages\\numpy.libs\\libscipy_openblas64_-43e11ff0749b8cbe0a615c9cf6737e0e.dll',
'version': '0.3.28',
'threading_layer': 'pthreads',
'architecture': 'Haswell'}]
In [5]: from ctypes import CDLL
# For the purpose of this local test I set the limit to a lower value than 2600 for convenience :) (but still higher than 260)
In [6]: CDLL("C:\\Users\\J\\R\\threadpoolctl\\aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
⋮ aaaaaaaaaaaaaaaaaaaaaaaaaaa\\bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
⋮ bbbbbbbbbbbbbbbbbb\\libopenblas_toooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo
⋮ ooooooooooooooooooo_long.dll")
Out[6]: <CDLL 'C:\Users\J\R\threadpoolctl\aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\libopenblas_tooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo_long.dll', handle 7ffce4130000 at 0x22b7f1d08f0>
In [7]: threadpool_info()
C:\Users\J\R\threadpoolctl\threadpoolctl.py:1103: RuntimeWarning: Could not get the full path of a dynamic library (path too
long). This library will be ignored and threadpoolctl might not be able to control or display information about all loaded
libraries. Here's the truncated path: 'C:\\Users\\J\\R\\threadpoolctl
\aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\\bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\\libopenblas_toooooooooooooooooooooooooooooooooooooooooooooooooooooooooo'
warnings.warn(
Out[7]:
[{'user_api': 'blas',
'internal_api': 'openblas',
'num_threads': 16,
'prefix': 'libscipy_openblas',
'filepath': 'C:\\Users\\J\\miniconda3\\envs\\joblib-dev\\Lib\\site-packages\\numpy.libs\\libscipy_openblas64_-43e11ff0749b8cbe0a615c9cf6737e0e.dll',
'version': '0.3.28',
'threading_layer': 'pthreads',
'architecture': 'Haswell'}] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #181