-
-
Notifications
You must be signed in to change notification settings - Fork 32k
bpo-31904: Only UTF-8 encoding is supported on VxWorks #13486
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
@@ -331,6 +331,8 @@ The :mod:`locale` module defines the following exception and functions: | |||
The function now always returns ``UTF-8`` on Android or if the UTF-8 mode | |||
is enabled. | |||
|
|||
On VxWorks, always return ``'UTF-8'``, the locale and the *do_setlocale* | |||
argument are ignored. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
argument are ignored. | |
argument is ignored. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"are" is used for "the locale" and "the do_setlocale argument".
This line is mostly the same as comment for Android at line 328:
On Android or in the UTF-8 mode (:option:-X
utf8
option), always
return 'UTF-8'
, the locale and the do_setlocale argument are ignored.
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 |
On VxWorks, always return "UTF-8" with sys.flags.utf8_mode is True in both locale.py&_bootlocale.py: |
I have made the requested changes; please review again. |
Thanks for making the requested changes! @vstinner: please review the changes made to this pull request. |
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. |
@pxinwr Thank you for letting me know |
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