Skip to content

Commit

Permalink
Add utf8 encoding to read_text to avoid Windows charmap crash
Browse files Browse the repository at this point in the history
  • Loading branch information
tomaarsen committed Oct 22, 2024
1 parent e118ecc commit f6e6712
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/huggingface_hub/hf_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -9562,7 +9562,7 @@ def _prepare_upload_folder_additions(
# It's better to fail early than to fail after all the files have been hashed.
if "README.md" in filtered_repo_objects:
self._validate_yaml(
content=relpath_to_abspath["README.md"].read_text(),
content=relpath_to_abspath["README.md"].read_text(encoding="utf8"),
repo_type=repo_type,
token=token,
)
Expand Down

0 comments on commit f6e6712

Please sign in to comment.