mesonbuild / meson-python

Meson PEP 517 Python build backend
https://mesonbuild.com/meson-python/
MIT License
125 stars 65 forks source link

BUG: use errors=replace for stdout #536

Closed dnicolodi closed 10 months ago

dnicolodi commented 10 months ago

Unfortunately the added test catches the issue reported in #535 only when run without pytest stdout capture (namely with the -s command line flag).

ankith26 commented 10 months ago

I can confirm that this PR fixes my issue. Instead of an error and build fail now, I get question mark symbols (?) in stdout in place of the korean characters, and the build finishes correctly.

dnicolodi commented 10 months ago

I can confirm that this PR fixes my issue. Instead of an error and build fail now, I get question mark symbols (?) in stdout in place of the korean characters, and the build finishes correctly.

Thanks for testing. We can choose other alternative representations for characters that cannot be represented in the current encoding. I went for the ? because it is the simplest. Other options that make sense are 'backslashreplace' or 'namereplace'. https://docs.python.org/3/library/codecs.html#error-handlers I don't have an opinion about which one is the best choice.

ankith26 commented 10 months ago

IMHO the 'replace' error handling is fine

rgommers commented 10 months ago

I went for the ? because it is the simplest

+1 from me, seems like a good choice.

dnicolodi commented 10 months ago

I'm moving dropping the colorama dependency to another PR and merging this one.