Fix infinite loop in WindowsFileLock
MEMBER
How is it possible to get an infinite loop ? Can you add more details ?
2021-04-14T13:44:30Z
https://github.com/huggingface/datasets/pull/2220#issuecomment-819529569
https://api.github.com/repos/huggingface/datasets/issues/2220
MDEyOklzc3VlQ29tbWVudDgxOTUyOTU2OQ==
https://api.github.com/repos/huggingface/datasets/issues/comments/819529569/reactions
2021-04-14T13:44:30Z
https://api.github.com/repos/huggingface/datasets/issues/comments/819529569
https://avatars.githubusercontent.com/u/42851186?v=4
https://api.github.com/users/lhoestq/events{/privacy}
https://api.github.com/users/lhoestq/followers
https://api.github.com/users/lhoestq/following{/other_user}
https://api.github.com/users/lhoestq/gists{/gist_id}
https://github.com/lhoestq
lhoestq
MDQ6VXNlcjQyODUxMTg2
https://api.github.com/users/lhoestq/orgs
https://api.github.com/users/lhoestq/received_events
https://api.github.com/users/lhoestq/repos
https://api.github.com/users/lhoestq/starred{/owner}{/repo}
https://api.github.com/users/lhoestq/subscriptions
User
https://api.github.com/users/lhoestq
public
MEMBER
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.
2021-04-14T14:07:36Z
https://github.com/huggingface/datasets/pull/2220#issuecomment-819546723
https://api.github.com/repos/huggingface/datasets/issues/2220
MDEyOklzc3VlQ29tbWVudDgxOTU0NjcyMw==
https://api.github.com/repos/huggingface/datasets/issues/comments/819546723/reactions
2021-04-14T14:08:16Z
https://api.github.com/repos/huggingface/datasets/issues/comments/819546723
https://avatars.githubusercontent.com/u/8515462?v=4
https://api.github.com/users/albertvillanova/events{/privacy}
https://api.github.com/users/albertvillanova/followers
https://api.github.com/users/albertvillanova/following{/other_user}
https://api.github.com/users/albertvillanova/gists{/gist_id}
https://github.com/albertvillanova
albertvillanova
MDQ6VXNlcjg1MTU0NjI=
https://api.github.com/users/albertvillanova/orgs
https://api.github.com/users/albertvillanova/received_events
https://api.github.com/users/albertvillanova/repos
https://api.github.com/users/albertvillanova/starred{/owner}{/repo}
https://api.github.com/users/albertvillanova/subscriptions
User
https://api.github.com/users/albertvillanova
public
MEMBER
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
2021-04-14T14:19:26Z
https://github.com/huggingface/datasets/pull/2220#issuecomment-819555465
https://api.github.com/repos/huggingface/datasets/issues/2220
MDEyOklzc3VlQ29tbWVudDgxOTU1NTQ2NQ==
https://api.github.com/repos/huggingface/datasets/issues/comments/819555465/reactions
2021-04-14T14:19:26Z
https://api.github.com/repos/huggingface/datasets/issues/comments/819555465
https://avatars.githubusercontent.com/u/42851186?v=4
https://api.github.com/users/lhoestq/events{/privacy}
https://api.github.com/users/lhoestq/followers
https://api.github.com/users/lhoestq/following{/other_user}
https://api.github.com/users/lhoestq/gists{/gist_id}
https://github.com/lhoestq
lhoestq
MDQ6VXNlcjQyODUxMTg2
https://api.github.com/users/lhoestq/orgs
https://api.github.com/users/lhoestq/received_events
https://api.github.com/users/lhoestq/repos
https://api.github.com/users/lhoestq/starred{/owner}{/repo}
https://api.github.com/users/lhoestq/subscriptions
User
https://api.github.com/users/lhoestq
public
MEMBER
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 ?
2021-04-14T14:23:35Z
https://github.com/huggingface/datasets/pull/2220#issuecomment-819558379
https://api.github.com/repos/huggingface/datasets/issues/2220
MDEyOklzc3VlQ29tbWVudDgxOTU1ODM3OQ==
https://api.github.com/repos/huggingface/datasets/issues/comments/819558379/reactions
2021-04-14T14:23:35Z
https://api.github.com/repos/huggingface/datasets/issues/comments/819558379
https://avatars.githubusercontent.com/u/42851186?v=4
https://api.github.com/users/lhoestq/events{/privacy}
https://api.github.com/users/lhoestq/followers
https://api.github.com/users/lhoestq/following{/other_user}
https://api.github.com/users/lhoestq/gists{/gist_id}
https://github.com/lhoestq
lhoestq
MDQ6VXNlcjQyODUxMTg2
https://api.github.com/users/lhoestq/orgs
https://api.github.com/users/lhoestq/received_events
https://api.github.com/users/lhoestq/repos
https://api.github.com/users/lhoestq/starred{/owner}{/repo}
https://api.github.com/users/lhoestq/subscriptions
User
https://api.github.com/users/lhoestq
public
Raise exception to avoid infinite loop.