Skip to content

Commit 6ac7aef

Browse files
tomaarsenWauplin
andauthored
Add utf8 encoding to read_text to avoid Windows charmap crash (#2627)
Co-authored-by: Lucain <[email protected]>
1 parent 7709178 commit 6ac7aef

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/huggingface_hub/hf_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9165,7 +9165,7 @@ def _prepare_upload_folder_additions(
91659165
# It's better to fail early than to fail after all the files have been hashed.
91669166
if "README.md" in filtered_repo_objects:
91679167
self._validate_yaml(
9168-
content=relpath_to_abspath["README.md"].read_text(),
9168+
content=relpath_to_abspath["README.md"].read_text(encoding="utf8"),
91699169
repo_type=repo_type,
91709170
token=token,
91719171
)

0 commit comments

Comments
 (0)