Open fraser-langton opened 3 hours ago
found the culprit using this script
from pathlib import Path
def check_files_for_charmap_error(glob_pattern):
# Use glob to filter files based on the provided pattern in the current directory
for file_path in Path().glob(glob_pattern): # Use the glob pattern to find matching files
if file_path.is_file(): # Ensure it's a file
if ".venv" in file_path.parts: # Exclude files in .venv directory
continue
try:
with file_path.open(encoding="cp1252") as f: # Windows default encoding
f.read()
except UnicodeDecodeError as e:
print(f"Error decoding {file_path}: {e}")
except Exception as e:
print(f"An error occurred with {file_path}: {e}")
if __name__ == "__main__":
glob_pattern = "**/*.py"
check_files_for_charmap_error(glob_pattern)
And this single char was the culprit: Í
Can't offer too much more info unfortunately, I literally opened my laptop up in the morning and the same command won't run, quite baffling