Skip to content

Conversation

Charlie-XIAO
Copy link
Contributor

Reference Issues/PRs

NA.

What does this implement/fix? Explain your changes.

When running doc build, some characters in examples/ cause UnicodeDecodeError for certain codec (e.g. gbk for my machine). The root cause is the following lines in the sphinx-gallery package which does not specify the encoding.

https://github.com/sphinx-gallery/sphinx-gallery/blob/a34b72cdcd52cc905761ea80282916af6638ec38/sphinx_gallery/recommender.py#L193-L195

This PR changes to - and “” to "" to avoid these errors.

Copy link

✔️ Linting Passed

All linting checks passed. Your pull request is in excellent shape! ☀️

Generated for commit: 8bb9047. Link to the linter CI: here

@lesteve
Copy link
Member

lesteve commented Dec 18, 2023

Can you open an issue in sphinx-gallery about this, or even a PR, basically the fix should be to specify the encoding i.e. something like read_text(encoding="utf-8") ? This seems like a sphinx-gallery short-coming that should get fixed.

I am fine with this work-around in the mean time.

@lesteve lesteve changed the title DOC resolve UnicodeDecodeError of recommender for certain codec when doc build MNT Work-around sphinx-gallery UnicodeDecodeError in recommender system Dec 18, 2023
@lesteve lesteve merged commit 94b8471 into scikit-learn:main Dec 18, 2023
@Charlie-XIAO Charlie-XIAO deleted the doc-decode-err branch December 18, 2023 10:21
@Charlie-XIAO
Copy link
Contributor Author

Sure, I have opened sphinx-gallery/sphinx-gallery#1244 for this.

glemaitre pushed a commit to glemaitre/scikit-learn that referenced this pull request Feb 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants