Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Set UTF8 encoding when writing text files #302

Merged
merged 2 commits into from
Feb 25, 2024
Merged

Set UTF8 encoding when writing text files #302

merged 2 commits into from
Feb 25, 2024

Conversation

maximlt
Copy link
Collaborator

@maximlt maximlt commented Feb 24, 2024

I tried building hvPlot's website with nbsite on Windows and it failed with:

  File "C:\hostedtoolcache\windows\Python\3.11.8\x64\Lib\site-packages\docutils\parsers\rst\states.py", line 2104, in directive
    return self.run_directive(
           ^^^^^^^^^^^^^^^^^^^
  File "C:\hostedtoolcache\windows\Python\3.11.8\x64\Lib\site-packages\docutils\parsers\rst\states.py", line 2154, in run_directive
    result = directive_instance.run()
             ^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\hostedtoolcache\windows\Python\3.11.8\x64\Lib\site-packages\nbsite\nbbuild.py", line 467, in run
    evaluate_notebook(
  File "C:\hostedtoolcache\windows\Python\3.11.8\x64\Lib\site-packages\nbsite\nbbuild.py", line 295, in evaluate_notebook
    f.write(newnb)
  File "C:\hostedtoolcache\windows\Python\3.11.8\x64\Lib\encodings\cp1252.py", line 19, in encode
    return codecs.charmap_encode(input,self.errors,encoding_table)[0]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
UnicodeEncodeError: 'charmap' codec can't encode character '\u25ba' in position 64474: character maps to <undefined>

I ran another pipeline pointing at this branch to confirm it fixes the issue.

@philippjfr
Copy link
Contributor

Looks good, thanks!

@maximlt maximlt merged commit e823aec into main Feb 25, 2024
5 checks passed
@maximlt maximlt deleted the set_encoding branch February 25, 2024 16:15
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants