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

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.)