File size: 282 Bytes
b7d0804
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
from pathlib import Path

files_to_fix = [
    Path("app/main.py"),
]

for path in files_to_fix:
    text = path.read_text(encoding="utf-8-sig")
    text = text.replace("\ufeff", "")
    path.write_text(text, encoding="utf-8")
    print(f"Fixed hidden BOM characters in {path}")