Replaced redundant mktemp() with mkstemp() #1754
Merged
Merged
Conversation
ThiefMaster
reviewed
Apr 4, 2022
| import tempfile | ||
|
|
||
| filename = tempfile.mktemp() | ||
| filename = tempfile.mkstemp() |
Member
There was a problem hiding this comment.
This doesn't look correct. mkstemp returns a tuple, but below we use filename as if it was a string filename...
Member
There was a problem hiding this comment.
Also further below, shouldn't we use subprocess.call() instead of os.system()? I don't think you can put anything nasty in the temp filename, but I think it'd also fail in other cases like cmd containing a space..
Member
There was a problem hiding this comment.
Treating the return as a tuple was fixed later. Using subprocess.call is an open issue #1476, I need to test things like this before I merge it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replaced redundant function with the recommended alternative.
Checklist:
CHANGES.rstsummarizing the change and linking to the issue.pre-commithooks and fix any issues.