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

fix assert_run_python_script on Windows #7346

Merged
merged 5 commits into from
Feb 27, 2023
Merged

Conversation

pmeier
Copy link
Collaborator

@pmeier pmeier commented Feb 27, 2023

All tests that use assert_run_python_script, fail on Windows. For example: https://app.circleci.com/pipelines/github/pytorch/vision/23631/workflows/9af6160b-70a4-480e-9593-0800b2c67547/jobs/1842615

I think the issue is that Windows does not allow to access a file from a another process while it is still opened. Instead of a temporary file that deletes itself after closing it, this PR adds a temporary directory that does the same. Inside the directory we can write to a regular file and close that before we start the subprocess.

Copy link
Member

@NicolasHug NicolasHug left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Philip

@pmeier pmeier marked this pull request as ready for review February 27, 2023 16:17
@pmeier pmeier merged commit 120e7af into pytorch:main Feb 27, 2023
@pmeier pmeier deleted the windows-assert-run branch February 27, 2023 21:02
@github-actions
Copy link

Hey @pmeier!

You merged this PR, but no labels were added. The list of valid labels is available at https://github.com/pytorch/vision/blob/main/.github/process_commit.py

facebook-github-bot pushed a commit that referenced this pull request Mar 30, 2023
Reviewed By: vmoens

Differential Revision: D44416618

fbshipit-source-id: 21cb1238610a295a19f5d27cf55c9e89520b76c6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants