blender/tools/check_source
Campbell Barton 87c4f47312 Fix #139585: Blender could erase OS root
Temporary directory handling had a logical error, assuming the
"session" temporary directory was owned and created by Blender
and could be recursively removed on exit.

However, it's possible creating the session sub-directory fails,
in that case the temporary directory was used for the "session".
This meant setting `C:\` as the temporary directory in the preferences
would attempt to recursively remove `C:\` on exit.

Resolve with the following changes:

- Only perform a recursive removal on the temporary directory
  if a session sub-directory was created.

- If the creating the user-preferences temporary "session" sub-directory
  fails fall back to the systems temporary directory and try to
  create the "session" directory there.

  Previously this was only done if the preference path didn't exist.
  The preferences path was still used if it existed but couldn't be
  written to.

Include a test to ensure this is working as expected.

Ref !144042
2025-08-06 23:13:58 +00:00
..
check_cmake_consistency.py Cleanup: quiet Python linter warnings 2024-12-11 11:26:24 +11:00
check_cmake_consistency_config.py CMake: add missing headers to source lists 2025-03-06 11:08:18 +11:00
check_deprecated.py Cleanup: declare __all__ for many scripts in tools/ 2025-01-04 20:27:58 +11:00
check_descriptions.py Cleanup: declare __all__ for many scripts in tools/ 2025-01-04 20:27:58 +11:00
check_header_duplicate.py Cleanup: declare __all__ for many scripts in tools/ 2025-01-04 20:27:58 +11:00
check_licenses.py Cleanup: spelling in comments, strings (make check_spelling_*) 2025-05-06 00:18:39 +00:00
check_mypy.py Cleanup: declare __all__ for many scripts in tools/ 2025-01-04 20:27:58 +11:00
check_mypy_config.py Fix #139585: Blender could erase OS root 2025-08-06 23:13:58 +00:00
check_spelling.py check_spelling: enable checking text in single quotes for C/C++ 2025-04-26 11:17:14 +00:00
check_spelling_config.py Cleanup: spelling (make check_spelling_*) 2025-07-20 14:59:19 +10:00
check_unused_defines.py Cleanup: declare __all__ for many scripts in tools/ 2025-01-04 20:27:58 +11:00
clang_array_check.py GPU: Unified DataFormat enum 2025-05-13 17:08:32 +02:00
project_source_info.py Cleanup: quiet warnings & simplify Popen use in project_source_info 2025-02-11 13:42:09 +11:00
static_check_clang.py Cleanup: declare __all__ for many scripts in tools/ 2025-01-04 20:27:58 +11:00
static_check_clang_array.py Cleanup: declare __all__ for many scripts in tools/ 2025-01-04 20:27:58 +11:00
static_check_cppcheck.py Cleanup: Grammar: Fix uses of "for e.g." 2025-05-29 21:21:18 +02:00
static_check_size_comments.py Tools: add a utility to validate array sizes 2025-05-23 14:04:26 +10:00