-
Notifications
You must be signed in to change notification settings - Fork 134
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
wip_dir Context Manager Rename Retry #639
Conversation
This fix will attempt to rename the temporary folder for 10sec. This is due to an issue on windows machines that causes the renaming of the temporary file to result in a PermissionError for several seconds after the last image is written.
Hi @TManzini! Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks! |
Thanks for the PR @TManzini Could you provide more context on the permission issue (e.g. any links)? |
Sure, unfortunately the details around this behavior are poorly documented, but here is the trail that I followed to arrive at the PR. When running the process_video script I kept getting
So the suggestion is to continuously retry the rename for a certain amount of time until the OS realizes the rename is okay, or it times out. I set 10s as an arbitrary number. This behavior only seems to occur on windows. |
Thanks for the context! Lets narrow the hack to the windows platform only. |
@TManzini If you could sign the CLA above, I'm happy to merge the PR to a branch and I will fix some minor issues there. |
Let me know if you are happy with this implementation |
This fix will attempt to rename the temporary folder for 10sec. This is due to an issue on windows machines that causes the renaming of the temporary folder to result in a PermissionError for several seconds after the last image is written.