Skip to content

Fix tempfiles on windows, fixes #646#647

Merged
woodruffw merged 8 commits intopypa:mainfrom
marickmanrho:main
Jul 24, 2023
Merged

Fix tempfiles on windows, fixes #646#647
woodruffw merged 8 commits intopypa:mainfrom
marickmanrho:main

Conversation

@marickmanrho
Copy link
Copy Markdown
Contributor

This PR fixes pip-audit on Windows machines by providing a work around for NamedTempFile. This workaround is implemented in the _util.py file as CustomNamedTempFile.

The CustomNamedTempFile creates a temporary file as expected but allows the file to be open and closed multiple times. CustomNamedTempFile also works as a contextmanager and closes+removes the file when exiting the context.

Copy link
Copy Markdown
Member

@woodruffw woodruffw left a comment

Choose a reason for hiding this comment

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

Sorry for the delay here; a couple of thoughts!

@marickmanrho
Copy link
Copy Markdown
Contributor Author

sorry about that, hastely comitted without running pylint.

Copy link
Copy Markdown
Member

@woodruffw woodruffw left a comment

Choose a reason for hiding this comment

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

LGTM, thank you @marickmanrho!

Signed-off-by: William Woodruff <william@trailofbits.com>
@woodruffw woodruffw enabled auto-merge (squash) July 24, 2023 17:29
@woodruffw woodruffw merged commit 4485d24 into pypa:main Jul 24, 2023
@woodruffw
Copy link
Copy Markdown
Member

This is included in 2.6.1, which is in the process of being released now. Thanks again!

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.

2 participants