Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

[BUG] Markdown blockquotes cause crash on Windows #3281

Open
2 tasks done
simoncozens opened this issue Feb 16, 2024 · 1 comment
Open
2 tasks done

[BUG] Markdown blockquotes cause crash on Windows #3281

simoncozens opened this issue Feb 16, 2024 · 1 comment

Comments

@simoncozens
Copy link

Describe the bug

Markdown blockquotes emit a U+258C (LEFT HALF BLOCK) character:

rich/rich/markdown.py

Lines 215 to 217 in 26152e9

padding = Segment("▌ ", style)
for line in lines:
yield padding

On Windows, that this causes the error:

 File "C:\hostedtoolcache\windows\Python\3.10.11\x64\lib\site-packages\rich\console.py", line 1673, in print
    with self:
  File "C:\hostedtoolcache\windows\Python\3.10.11\x64\lib\site-packages\rich\console.py", line 865, in __exit__
    self._exit_buffer()
  File "C:\hostedtoolcache\windows\Python\3.10.11\x64\lib\site-packages\rich\console.py", line 823, in _exit_buffer
    self._check_buffer()
  File "C:\hostedtoolcache\windows\Python\3.10.11\x64\lib\site-packages\rich\console.py", line 2027, in _check_buffer
    legacy_windows_render(buffer, LegacyWindowsTerm(self.file))
  File "C:\hostedtoolcache\windows\Python\3.10.11\x64\lib\site-packages\rich\_windows_renderer.py", line 17, in legacy_windows_render
    term.write_styled(text, style)
  File "C:\hostedtoolcache\windows\Python\3.10.11\x64\lib\site-packages\rich\_win32_console.py", line 442, in write_styled
    self.write_text(text)
  File "C:\hostedtoolcache\windows\Python\3.10.11\x64\lib\site-packages\rich\_win32_console.py", line 403, in write_text
    self.write(text)
  File "C:\hostedtoolcache\windows\Python\3.10.11\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 '\u258c' in position 0: character maps to <undefined>

https://github.com/fonttools/fontbakery/actions/runs/7931077595/job/21657155530

Platform

Click to expand

What platform (Win/Linux/Mac) are you running on?

Windows

What terminal software are you using?

No terminal; we're in a GitHub CI job, so we're writing to standard output.

Copy link

Thank you for your issue. Give us a little time to review it.

PS. You might want to check the FAQ if you haven't done so already.

This is an automated reply, generated by FAQtory

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant