Skip to content

Commit

Permalink
fix: file open encoding error
Browse files Browse the repository at this point in the history
  • Loading branch information
Stephen-RA-King committed Apr 17, 2023
1 parent 9db5538 commit 4304034
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/pynball/pynball.py
Original file line number Diff line number Diff line change
Expand Up @@ -786,9 +786,10 @@ def glob_to_re(glob_list: list) -> str:
elif old_name in str(file) and file.stem not in ignore_dirs:
dir_name_change.append(file)

# TODO: find a solution to possible encoding issues here
# replace text inside files
for file in file_search:
text = file.read_text()
text = file.read_text(encoding="utf-8", errors="ignore")
text = text.replace(old_name, new_name)
file.write_text(text)

Expand Down

0 comments on commit 4304034

Please sign in to comment.