mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-04-15 21:12:30 +08:00
On Windows, os.path.commonpath raises ValueError when the two paths reside on different drives (e.g. C:\ vs D:\). This crashed ComfyUI with an unhandled exception whenever output/input/upload directories were on a different drive than the ComfyUI installation. Add folder_paths.is_path_within_directory() as a safe wrapper that catches ValueError and returns False (different drives means the path is clearly not inside the directory). Replace all bare os.path.commonpath security checks across server.py, folder_paths.py, and app/user_manager.py with this helper. In comfy/sd1_clip.py, narrow the bare except clause to except ValueError with a descriptive comment. Fixes #1488 |
||
|---|---|---|
| .. | ||
| app_test | ||
| assets_test | ||
| comfy_api_test | ||
| comfy_extras_test | ||
| comfy_quant | ||
| comfy_test | ||
| execution_test | ||
| folder_paths_test | ||
| prompt_server_test | ||
| seeder_test | ||
| server/utils | ||
| server_test | ||
| utils | ||
| feature_flags_test.py | ||
| README.md | ||
| requirements.txt | ||
| websocket_feature_flags_test.py | ||
Pytest Unit Tests
Install test dependencies
pip install -r tests-unit/requirements.txt
Run tests
pytest tests-unit/