FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Replace use of mktemp by EliahKagan · Pull Request #56 · gitpython-developers/smmap · GitHub

This repository was archived by the owner on Jul 26, 2026. It is now read-only.
/ smmap Public archive

Replace use of mktemp - #56

Merged
Byron merged 1 commit into
gitpython-developers:masterfrom
EliahKagan:no-mktemp
Dec 13, 2023
Merged

Replace use of mktemp#56
Byron merged 1 commit into
gitpython-developers:masterfrom
EliahKagan:no-mktemp

Conversation

EliahKagan commented Dec 13, 2023
edited
Loading

Copy link
Copy Markdown
Member

Fixes #41

This uses NamedTemporaryFile with delete=False to replace the one use of the deprecated mktemp function in smmap (reported in #41).

This avoids the race condition inherent to mktemp, as the file is named and created together in a way that is effectively atomic.

Because NamedTemporaryFile is not being used to automatically delete the file, it use and cleanup are unaffected by the change.

(This PR is conceptually related to gitpython-developers/GitPython#1770.)

This uses NamedTemporaryFile with delete=False to replace the one
use of the deprecated mktemp function in smmap (reported in gitpython-developers#41).

This avoids the race condition inherent to mktemp, as the file is
named and created together in a way that is effectively atomic.

Because NamedTemporaryFile is not being used to automatically
delete the file, it use and cleanup are unaffected by the change.

Byron left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Thanks a lot!

Byron merged commit 04dd210 into gitpython-developers:master Dec 13, 2023
EliahKagan deleted the no-mktemp branch December 13, 2023 10:15
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.

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Don't use mktemp

2 participants


Back | FazBrowse Home | New Git URL