if filename.endswith(".txt.txt"): safe_filename = filename.replace(".txt.txt", ".txt") # Log incident for user warn_user("Double extension detected. Renaming for safety.") Use code with caution. Copied to clipboard
is this for (Windows, macOS, or a custom app)? Knowing this will help me refine the code or steps! .txt.txt
The "Save As" dialogue MUST prompt the user to normalize the file to a single .txt extension. if filename
Default text editors (e.g., Notepad, TextEdit) SHOULD open .txt.txt files directly. TextEdit) SHOULD open .txt.txt files directly.