pylint-dev / pylint

It's not just a linter that annoys you!
https://pylint.readthedocs.io/en/latest/
GNU General Public License v2.0
5.18k stars 1.1k forks source link

Fix a crash when a pylint must display unicode raising a UnicodeEncodeError #9732

Open Pierre-Sassoulas opened 2 weeks ago

Pierre-Sassoulas commented 2 weeks ago

Type of Changes

Type
:bug: Bug fix

Description

Work in progress for #8736, this is probably not the right fix, but it's a fix. Hoping for a surrogates/unicode expert to chime in with the right approach 😄 !

Pierre-Sassoulas commented 2 weeks ago

We should probably aim to keep the \ud800\udc00 format instead of transforming to actual utf32 characters.

DanielNoord commented 1 week ago

https://stackoverflow.com/questions/27366479/python-3-os-walk-file-paths-unicodeencodeerror-utf-8-codec-cant-encode-s

encode('utf8','replace') seems to work? Although I really don't like that we need to add special logic for a really uncommon case..