Reported by Paul Eggert in
<https://lists.gnu.org/archive/html/bug-gnulib/2024-04/msg00367.html>.
* gnulib-tool.py: Set PYTHONPYCACHEPREFIX, so as to avoid creating a
__pycache__ directory in the developer's gnulib checkout (only effective
with Python ≥ 3.8).
+2024-04-22 Bruno Haible <bruno@clisp.org>
+
+ gnulib-tool.py: Fix trouble caused by Python's bytecode cache.
+ Reported by Paul Eggert in
+ <https://lists.gnu.org/archive/html/bug-gnulib/2024-04/msg00367.html>.
+ * gnulib-tool.py: Set PYTHONPYCACHEPREFIX, so as to avoid creating a
+ __pycache__ directory in the developer's gnulib checkout (only effective
+ with Python ≥ 3.8).
+
2024-04-21 Collin Funk <collin.funk1@gmail.com>
gnulib-tool.py: Make temporary directories recognizable.
func_fatal_error "python3 not found; try setting GNULIB_TOOL_IMPL=sh"
fi
+# Tell Python to store the compiled bytecode outside the gnulib directory.
+if test -z "$PYTHONPYCACHEPREFIX"; then
+ PYTHONPYCACHEPREFIX="${TMPDIR-/tmp}/gnulib-python-cache-${USER-$LOGNAME}"
+ export PYTHONPYCACHEPREFIX
+fi
+
profiler_args=
# For profiling, cf. <https://docs.python.org/3/library/profile.html>.
#profiler_args="-m cProfile -s tottime"