Skip to content

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

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Doc/library/locale.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
argument are ignored.
argument is ignored.

Copy link
Contributor Author

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.


.. function:: normalize(localename)

Expand Down
4 changes: 4 additions & 0 deletions Lib/test/test_c_locale_coercion.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@
# TODO: Work out a robust dynamic test for this that doesn't rely on
# CPython's own locale handling machinery
EXPECT_COERCION_IN_DEFAULT_LOCALE = False
elif sys.platform == "vxworks":
# VxWorks defaults to using UTF-8 for all system interfaces
EXPECTED_C_LOCALE_STREAM_ENCODING = "utf-8"
EXPECTED_C_LOCALE_FS_ENCODING = "utf-8"

# Note that the above expectations are still wrong in some cases, such as:
# * Windows when PYTHONLEGACYWINDOWSFSENCODING is set
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Port test_c_locale_coercion to VxWorks: only UTF-8 encoding is supported on VxWorks