Skip to content

Conversation

@albertvillanova
Copy link
Member

Raise exception to avoid infinite loop.

@lhoestq
Copy link
Member

lhoestq commented Apr 14, 2021

How is it possible to get an infinite loop ? Can you add more details ?

@albertvillanova
Copy link
Member Author

albertvillanova commented Apr 14, 2021

Yes, in Windows, if the filename is too long, a FileNotFoundError is raised. The exception should be raised in this case. Otherwise, we get into an infinite loop.

If other process has the file locked, then PermissionError is raised. In this case, pass is OK.

@lhoestq
Copy link
Member

lhoestq commented Apr 14, 2021

Note that the filelock module comes from this project that hasn't changed in years - while still being used by ten of thousands of projects:
https://github.com/benediktschmitt/py-filelock

Unless we have proper tests for this, I wouldn't recommend to change it

@lhoestq
Copy link
Member

lhoestq commented Apr 14, 2021

I'm pretty sure many things from the library could break for windows users that haven't disabled the max path length limit.
Maybe it would be simpler to simply raise an error on startup. For exampe, for windows users the error could ask them to disable the limit if it's not been disabled yet ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

wontfix This will not be worked on

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants