Skip to content

Commit 44236d0

Browse files
committed
fix: Fix default encoding when opening files
1 parent 00f64ac commit 44236d0

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

code_embedder/code_embedding.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ def _read_readme(self, readme_path: str) -> list[str]:
5353
if not readme_path.endswith(".md"):
5454
raise ValueError("README path must end with .md")
5555

56-
with open(readme_path) as readme_file:
56+
with open(readme_path, encoding="utf-8") as readme_file:
5757
return readme_file.readlines()
5858

5959
def _extract_scripts(
@@ -86,5 +86,5 @@ def _update_readme(
8686

8787
updated_readme += readme_content[readme_content_cursor:]
8888

89-
with open(readme_path, "w") as readme_file:
89+
with open(readme_path, "w", encoding="utf-8") as readme_file:
9090
readme_file.writelines(updated_readme)

code_embedder/script_content_reader.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def _read_full_script(self, scripts: list[ScriptMetadata]) -> list[ScriptMetadat
2424

2525
for script in scripts:
2626
try:
27-
with open(script.path) as script_file:
27+
with open(script.path, encoding="utf-8") as script_file:
2828
script.content = script_file.read()
2929
scripts_with_full_contents.append(script)
3030

0 commit comments

Comments
 (0)