-
Notifications
You must be signed in to change notification settings - Fork 36
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
UnicodeDecodeError cause by system encoding #13
Comments
Hi @WEGFan, thanks a lot for letting us know. This section of code is using a background thread to read the standard error stream produced by Chromium. I'll need to dig into this bit more deeply, but your suggestion makes sense. We are also explicitly using the UTF-8 encoding when writing JSON image export requests to standard in for the Kaleido C++ executable, and when reading the resulting JSON export results from standard out. Are you running into any issues with the resulting images? Have you tried the SVG format? Thanks! |
The result images have no issues and exporting SVG format still getting the error. |
Ok, great. Thanks for the info! |
@WEGFan do get the same encoding from
|
Nope. >>> import sys
>>> import locale
>>> sys.stderr.encoding
'utf-8'
>>> locale.getpreferredencoding()
'cp936' |
I took a look at Python 3
And
So maybe using |
Thanks, I just opened #17 which should take care of it. It delays encoding until we actually need to display to the user, then it attemps to decode using |
When I try to export to a static image, the following error occurs but I still can get the image correctly.
So I debugged the line at
val = self._proc.stderr.readline().decode('utf-8')
and found that it should be decode as gb2312 because this is my system encoding.I think this line should be changed to
The text was updated successfully, but these errors were encountered: