From a944da76c07e92ea26a4552b78504ac67dedb91c Mon Sep 17 00:00:00 2001 From: native-api Date: Sun, 21 Dec 2025 06:38:46 +0300 Subject: [PATCH] rehash: support BSD mktemp (#3376) macOS 12 `mktemp' doesn't support `-p` --- libexec/pyenv-rehash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libexec/pyenv-rehash b/libexec/pyenv-rehash index 61000ff6..3dc7c291 100755 --- a/libexec/pyenv-rehash +++ b/libexec/pyenv-rehash @@ -52,7 +52,7 @@ while (( SECONDS <= start + ${PYENV_REHASH_TIMEOUT:-60} )); do #So check for writablity by trying to write to a different file, # in a way that taxes the usual use case as little as possible. if [[ -z $tested_for_other_write_errors ]]; then - ( t="$(mktemp -p "$SHIM_PATH")" && rm "$t" ) && tested_for_other_write_errors=1 || + ( t="$(TMPDIR="$SHIM_PATH" mktemp)" && rm "$t" ) && tested_for_other_write_errors=1 || { echo "pyenv: cannot rehash: $SHIM_PATH isnt writable" >&2; break; } fi # POSIX sleep(1) doesn't provide subsecond precision, but many others do