bpo-31904: Only UTF-8 encoding is supported on VxWorks#13486
Conversation
vstinner
left a comment
There was a problem hiding this comment.
Your doc is wrong: getpreferredencoding() isn't hardcoded to UTF-8 on VxWorks.
You have to hack Lib/_bootlocale.py and Lib/locale.py using sys.platform == "vxworks" to make this effective.
I guess that you can just replace if hasattr(sys, 'getandroidapilevel'): with if hasattr(sys, 'getandroidapilevel') and sys.platform == "vxworks":, and update the related comments.
Sorry, something went wrong.
|
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
Sorry, something went wrong.
On VxWorks, always return "UTF-8" with sys.flags.utf8_mode is True in both locale.py&_bootlocale.py: |
Sorry, something went wrong.
|
I have made the requested changes; please review again. |
Sorry, something went wrong.
|
Thanks for making the requested changes! @vstinner: please review the changes made to this pull request. |
Sorry, something went wrong.
|
The author of this PR has quit the job. A new PR #19448 was created to replace this one. Please anyone helps to close this PR. |
Sorry, something went wrong.
VxWorks uses UTF-8 as the system encoding. So the test case test_c_locale_coercion.py need to be updated to use UTF-8 on VxWorks.
https://bugs.python.org/issue31904