blender/tests
Campbell Barton 5dfd1bc36b 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-19 16:37:51 +02:00
..
blender_as_python_module License Headers: Set copyright to "Blender Authors", add AUTHORS 2023-08-16 00:20:26 +10:00
files Move tests/data and assets to the main repository 2025-05-06 13:42:47 +02:00
gtests Move tests/data and assets to the main repository 2025-05-06 13:42:47 +02:00
performance Fix: Benchmarks auto build not working with new lib directories 2024-06-06 19:52:55 +02:00
python Fix #139585: Blender could erase OS root 2025-08-19 16:37:51 +02:00
utils Tests: update default library path for batch blendfile loader 2024-02-23 14:57:05 +11:00
CMakeLists.txt Cleanup: line length in CMake files 2024-03-07 13:26:55 +11:00