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

update max_len limit for windows to 32767 #62

Open
fthmko opened this issue Feb 14, 2025 · 3 comments
Open

update max_len limit for windows to 32767 #62

fthmko opened this issue Feb 14, 2025 · 3 comments
Milestone

Comments

@fthmko
Copy link

fthmko commented Feb 14, 2025

The path length limitation has been increased to 32767 since Windows 10 version 1607 with a registry setting.
Additionally, during Python installation, there is an option disable path length limit which helps achieve this.

I think it’s more reasonable to update this limitation from 260 to 32767 or provide a configuration option.

@thombashi
Copy link
Owner

@fthmko
Thank you for your feedback.
However, I don't think it's appropriate to change the default value at this time because long paths require support on the app side.
The maximum path length can be changed with the max_len argument of the functions.
Is that not enough?

@fthmko
Copy link
Author

fthmko commented Feb 17, 2025

Thank you for your reply, I respect your decision.
However, another argument or configuration is also necessary.

At this time, the max_len argument in validate_filepath will be overridden by min(self._max_len, platform_max_len) in the BaseFile class. The value of platform_max_len argument is set to the platform's default because it's not exposed.

As a result, larger value will not have any effect.

To validate long paths, I have to modify the internal _max_len, which isn't an ideal practice.

validator = FilePathValidator(platform='auto')
validator._max_len = 32767
validator.validate(some_long_path)

@thombashi
Copy link
Owner

That is certainly true.
However, changing this behavior would be a breaking change, so even if it is fixed, it will probably be in the next major version update (v4).

@thombashi thombashi added this to the V4 milestone Feb 22, 2025
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

No branches or pull requests

2 participants