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

Upgrade and Secure Temp File Creation #9479

Conversation

pixeeai
Copy link

@pixeeai pixeeai commented May 4, 2024

This codemod replaces all tempfile.mktemp calls to the more secure tempfile.mkstemp.

The Python tempfile documentation is explicit
that tempfile.mktemp should be deprecated to avoid an unsafe and unexpected race condition.
The changes from this codemod look like this:

  import tempfile
- tempfile.mktemp(...)
+ tempfile.mkstemp(...)
More reading

Powered by: pixeebot (codemod ID: pixee:python/secure-tempfile)

Copy link

CLA Not Signed

@kapilt
Copy link
Collaborator

kapilt commented May 10, 2024

Not clear who setup the bot, but its not going to able to sign the cla, and the relevant patch against unit test code so also not relevant from a runtime security consideration.

@kapilt
Copy link
Collaborator

kapilt commented May 10, 2024

Also this bot appears to suggesting a broken change, in that it’s not able to account for the return signature change, hence the changed test code fails to run. Closing as useless noise as a result.

@kapilt kapilt closed this May 10, 2024
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.

None yet

2 participants