Add UTF-8 encoding to file operations in multiple modules - #754
Add UTF-8 encoding to file operations in multiple modules#754IndigoCarmine wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
No quality gates enabled for this code.
See analysis details in CodeScene
Quality Gate Profile: Custom Configuration
Install CodeScene MCP: safeguard and uplift AI-generated code. Catch issues early with our IDE extension and CLI tool.
|
I can believe this fixes the problem, but having to modify every open statement in every every python module in every application is an icky solution. Python 3.15 will fix the issue by making UTF-8 the default when it is released in October. It'll probably take a couple of months for dependencies (numpy, scipy, etc.) to be updated. The CP932 encoding shares code points with ASCII, so decoding is not a problem if only ASCII characters are used in the model definition. Since the problem is only with adaptive.c, I suggest removing the non-ASCII characters from that file and wait for the problem to fix itself. The documentation describing how to implement adaptive integration belongs in Another option is to modify the SasView startup on Windows to set |
|
Thank you for the reply. I also considered removing the non-ASCII chars from I think we should instead make the environment able to handle any Unicode character. Your second option, setting In the meantime, affected users can work around it with On the "modifying every open statement is icky" point - within I'd like to hear other opinions too. |
SasView/sasview#4095
For this issue, I added the encoding="utf-8" argument so that model source files are explicitly read as UTF-8.
This fixes the UnicodeDecodeError that occurs when building plugin models on Windows systems using a non-UTF-8 locale, such as the Japanese locale.