Warning for user when Windows default Path Limit is exceeded#10046
Conversation
uranusjr
left a comment
There was a problem hiding this comment.
Couple of thoughts:
erroris an exception, so you need tostr()it first.- We should probably check
error.errnoto make sure we’re catching aFileNotFoundError. - The error message should include a link to some Microsoft documentation. I don’t except people having Long Paths off would understand what set LongPathsEnabled to 1 means.
For the second suggestion. Can I go forward with a check like |
|
Yeah, sounds right to me. |
And last question I had for the final suggestion, I am going forward with this microsoft documentation in particular: https://docs.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation?tabs=cmd#enable-long-paths-in-windows-10-version-1607-and-later |
|
Damn, that’s a long one. I guess that’s the best we can have though, since it’s Microsoft. |
Yeah that is the only decent one I found which belonged exclusively to Microsoft. As of now I have updated the PR with all the requested changes, please take a look when it is possible for you. Thanks! |
pradyunsg
left a comment
There was a problem hiding this comment.
LGTM! Happy to have this merged once CI is happy. :)
|
Thanks for your contribution @OBITORASU! ^>^ |
Description
This PR generates a warning message for the end-user informing them about the potential errors which might be caused if they have Long Paths disabled on their Windows system. I have used:
as the means to check the host OS as suggested by the maintainers and added an if statement to check for the
260default path length limit when Long Paths is disabled. The if statement will successfully trigger a warning usinglogger.warningin case the host OS is Windows and the error message length (which also contains the path) is greater than 260 characters.Fixes Issue #10045