From 5fedc2326618706671749950bc972bac21ae45d2 Mon Sep 17 00:00:00 2001 From: Hongchang Liu Date: Tue, 19 Mar 2019 17:05:01 +0800 Subject: [PATCH 1/3] bpo-31904: fix test_utf8_mode fail issue on VxWorks VxWorks uses UTF-8 as the system encoding. --- Lib/test/test_utf8_mode.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Lib/test/test_utf8_mode.py b/Lib/test/test_utf8_mode.py index 220ff34a1189ce..9595629a254939 100644 --- a/Lib/test/test_utf8_mode.py +++ b/Lib/test/test_utf8_mode.py @@ -12,7 +12,7 @@ MS_WINDOWS = (sys.platform == 'win32') POSIX_LOCALES = ('C', 'POSIX') - +_vxworks = (sys.platform == "vxworks") class UTF8ModeTests(unittest.TestCase): DEFAULT_ENV = { @@ -225,7 +225,7 @@ def check(utf8_opt, expected, **kw): with self.subTest(LC_ALL=loc): check('utf8', [arg_utf8], LC_ALL=loc) - if sys.platform == 'darwin' or support.is_android: + if sys.platform == 'darwin' or support.is_android or _vxworks: c_arg = arg_utf8 elif sys.platform.startswith("aix"): c_arg = arg.decode('iso-8859-1') From 0ecfe87ff95d3511eebcd51cd2556e6a03bfbfd4 Mon Sep 17 00:00:00 2001 From: Hongchang Liu Date: Tue, 19 Mar 2019 17:45:12 +0800 Subject: [PATCH 2/3] bpo-31904: add missing rst files --- Misc/NEWS.d/next/Tests/2019-03-19-17-39-25.bpo-31904.QxhhRx.rst | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 Misc/NEWS.d/next/Tests/2019-03-19-17-39-25.bpo-31904.QxhhRx.rst diff --git a/Misc/NEWS.d/next/Tests/2019-03-19-17-39-25.bpo-31904.QxhhRx.rst b/Misc/NEWS.d/next/Tests/2019-03-19-17-39-25.bpo-31904.QxhhRx.rst new file mode 100644 index 00000000000000..72006f2097cd4c --- /dev/null +++ b/Misc/NEWS.d/next/Tests/2019-03-19-17-39-25.bpo-31904.QxhhRx.rst @@ -0,0 +1,2 @@ +VxWorks uses UTF-8 as the system encoding. So the test case test_utf8_mode.py +need to be updated to use UTF-8 on VxWorks. From df7d5d403fc841ff15d11fbae06abf0a20c6e065 Mon Sep 17 00:00:00 2001 From: Hongchang Liu Date: Wed, 27 Mar 2019 09:53:38 +0800 Subject: [PATCH 3/3] bpo-31904: fix test_utf8_mode fail issue on VxWorks Replace _vxworks with VXWORKS for VxWorks --- Lib/test/test_utf8_mode.py | 4 ++-- .../next/Tests/2019-03-19-17-39-25.bpo-31904.QxhhRx.rst | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/Lib/test/test_utf8_mode.py b/Lib/test/test_utf8_mode.py index 9595629a254939..2429b00459be51 100644 --- a/Lib/test/test_utf8_mode.py +++ b/Lib/test/test_utf8_mode.py @@ -12,7 +12,7 @@ MS_WINDOWS = (sys.platform == 'win32') POSIX_LOCALES = ('C', 'POSIX') -_vxworks = (sys.platform == "vxworks") +VXWORKS = (sys.platform == "vxworks") class UTF8ModeTests(unittest.TestCase): DEFAULT_ENV = { @@ -225,7 +225,7 @@ def check(utf8_opt, expected, **kw): with self.subTest(LC_ALL=loc): check('utf8', [arg_utf8], LC_ALL=loc) - if sys.platform == 'darwin' or support.is_android or _vxworks: + if sys.platform == 'darwin' or support.is_android or VXWORKS: c_arg = arg_utf8 elif sys.platform.startswith("aix"): c_arg = arg.decode('iso-8859-1') diff --git a/Misc/NEWS.d/next/Tests/2019-03-19-17-39-25.bpo-31904.QxhhRx.rst b/Misc/NEWS.d/next/Tests/2019-03-19-17-39-25.bpo-31904.QxhhRx.rst index 72006f2097cd4c..95771508619e5b 100644 --- a/Misc/NEWS.d/next/Tests/2019-03-19-17-39-25.bpo-31904.QxhhRx.rst +++ b/Misc/NEWS.d/next/Tests/2019-03-19-17-39-25.bpo-31904.QxhhRx.rst @@ -1,2 +1 @@ -VxWorks uses UTF-8 as the system encoding. So the test case test_utf8_mode.py -need to be updated to use UTF-8 on VxWorks. +Fix test_utf8_mode on VxWorks: Python always use UTF-8 on VxWorks.