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 conda lock install on windows #167

Merged
merged 1 commit into from
Mar 10, 2022

Conversation

mariusvniekerk
Copy link
Collaborator

Fixes #165

Unify the way we make temporary files and pass them to conda. This should fix PermissionError issues on windows

Unify the way we make temporary files and pass them to conda.  This should fix PermissionError issues on windows
@netlify
Copy link

netlify bot commented Mar 9, 2022

✔️ Deploy Preview for conda-lock ready!

🔨 Explore the source changes: c26bf0d

🔍 Inspect the deploy log: https://app.netlify.com/sites/conda-lock/deploys/6228ec38e324920008efb772

😎 Browse the preview: https://deploy-preview-167--conda-lock.netlify.app

def temporary_file_with_contents(content: str) -> Iterator[pathlib.Path]:
"""Generate a temporary file with the given content. This file can be used by subprocesses

On Windows, NamedTemporaryFiles can't be opened a second time, so we have to close it first (and delete it manually later)
Copy link
Member

Choose a reason for hiding this comment

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

you can create a tempfile.TemporaryDirectory and put the file there, after it leaves the context manager the folder will be deleted

@ocefpaf ocefpaf merged commit 9a1132d into conda:main Mar 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

PermissionError when trying to conda-lock install on Windows
3 participants