Expected Behavior
Running pre-commit run --all should complete without issue.
Actual Behavior
Running pre-commit run --all fails in a containerized environment with:
clean_customized_doctypes................................................Failed
- hook id: clean_customized_doctypes
- exit code: 1
Traceback (most recent call last):
File "/home/frappeuser/.cache/pre-commit/repos_9wqowq/py_env-python3.12/bin/clean_customized_doctypes", line 8, in <module>
sys.exit(main())
^^^^^^
File "/home/frappeuser/.cache/pre-commit/repos_9wqowq/py_env-python3.12/lib/python3.12/site-packages/test_utils/pre_commit/clean_customized_doctypes.py", line 76, in main
modified_files = validate_and_clean_customized_doctypes(customized_doctypes)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/frappeuser/.cache/pre-commit/repos_9wqowq/py_env-python3.12/lib/python3.12/site-packages/test_utils/pre_commit/clean_customized_doctypes.py", line 59, in validate_and_clean_customized_doctypes
os.replace(temp_file_path, customize_file)
OSError: [Errno 18] Invalid cross-device link: '/tmp/tmpiocgsndi' -> '/home/frappeuser/frappe-bench/apps/align/align/align/custom/project_template.json'
Proposed Fix
Replace os.replace() with shutil.move() in clean_customized_doctypes:59
Expected Behavior
Running
pre-commit run --allshould complete without issue.Actual Behavior
Running
pre-commit run --allfails in a containerized environment with:Proposed Fix
Replace
os.replace()withshutil.move()in clean_customized_doctypes:59