Describe the bug
When running the script on Windows and choosing to organize files by size, the program tries to create folders with names containing invalid characters (like < and >), causing an OSError: [WinError 123] because Windows does not allow those characters in folder names.
To Reproduce
Steps to reproduce the behavior:
- Run the script in the Windows Command Prompt.
- Leave the folder path blank or enter a valid folder path.
- Choose organization mode: 3 (By File Size).
- The program attempts to create folders with names such as
Small (<1MB) and crashes with a syntax error for the folder name.
Expected behavior
The program should sanitize folder names to remove or replace invalid characters so that it works correctly on Windows.
Desktop (please complete the following information):
- OS: Windows 11
- Python version: e.g. 3.11
Additional context
This issue only appears on Windows because of filename restrictions.