From b8d20da0756feded67cf8bba0f8c0f1c0a3361d4 Mon Sep 17 00:00:00 2001 From: Timothy Redaelli Date: Jun 08 2017 13:23:20 +0000 Subject: Remove PYTHONCOERCECLOCALE=0 workaround and backport upstream patch Resolves: #1454364 --- diff --git a/openvswitch.spec b/openvswitch.spec index dfe079d..40750a4 100644 --- a/openvswitch.spec +++ b/openvswitch.spec @@ -30,7 +30,7 @@ Name: openvswitch Version: 2.7.0 -Release: 3%{?snapshot}%{?dist} +Release: 4%{?snapshot}%{?dist} Summary: Open vSwitch daemon/database/utilities # Nearly all of openvswitch is ASL 2.0. The bugtool is LGPLv2+, and the @@ -43,6 +43,7 @@ Source1: http://fast.dpdk.org/rel/dpdk-%{dpdkver}.tar.gz Source2: ovs-snapshot.sh Patch1: openvswitch-CVE-2017-9214.patch +Patch2: tests-Export-PYTHONCOERCECLOCALE-0-for-python3-tests.patch %if %{with dpdk} %define dpdkarches x86_64 i686 aarch64 ppc64le @@ -304,8 +305,6 @@ sed -i.old -e "s/^AC_INIT(openvswitch,.*,/AC_INIT(openvswitch, %{version},/" con ./boot.sh %endif -export PYTHONCOERCECLOCALE=0 - %configure \ --enable-ssl \ %if %{with dpdk} @@ -377,8 +376,6 @@ rm -f $RPM_BUILD_ROOT/%{_bindir}/ovs-benchmark \ %check %if %{with check} - export PYTHONCOERCECLOCALE=0 - if make check TESTSUITEFLAGS='%{_smp_mflags}' || make check TESTSUITEFLAGS='--recheck'; then :; else @@ -650,6 +647,9 @@ rm -rf $RPM_BUILD_ROOT %{_unitdir}/ovn-controller-vtep.service %changelog +* Wed Jun 07 2017 Timothy Redaelli - 2.7.0-4 +- Remove PYTHONCOERCECLOCALE=0 workaround and backport upstream patch (#1454364) + * Wed May 31 2017 Timothy Redaelli - 2.7.0-3 - Backport fix for CVE-2017-9214 (#1456797) - Use %%autosetup instead of %%setup diff --git a/tests-Export-PYTHONCOERCECLOCALE-0-for-python3-tests.patch b/tests-Export-PYTHONCOERCECLOCALE-0-for-python3-tests.patch new file mode 100644 index 0000000..180939b --- /dev/null +++ b/tests-Export-PYTHONCOERCECLOCALE-0-for-python3-tests.patch @@ -0,0 +1,46 @@ +From 6180d2a53ac63e9e11c945e438faffceee30f6a1 Mon Sep 17 00:00:00 2001 +From: Timothy Redaelli +Date: Mon, 5 Jun 2017 15:28:38 +0200 +Subject: [PATCH] tests: Export PYTHONCOERCECLOCALE=0 for python3 tests + +This patch exports PYTHONCOERCECLOCALE=0 when you have Python3 tests +enabled. +This is needed since testsuite forces LC_ALL=C and Python 3, with PEP 538, +prints the following warning on stderr: + +"Python runtime initialized with LC_CTYPE=C (a locale with default ASCII +encoding), which may cause Unicode compatibility problems. Using C.UTF-8, +C.utf8, or UTF-8 (if available) as alternative Unicode-compatible locales is +recommended." + +AT_CHECK reports it as an error since stderr is not empty as it should be. + +This patch is needed, at least, on Fedora 26 and Rawhide (backported PEP +538 on Python 3.6). +This will also be needed on any distribution with Python 3.7 (PEP 538). + +Signed-off-by: Timothy Redaelli +Signed-off-by: Ben Pfaff +--- + tests/atlocal.in | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/tests/atlocal.in b/tests/atlocal.in +index bc2480bff..015817c46 100644 +--- a/tests/atlocal.in ++++ b/tests/atlocal.in +@@ -11,6 +11,11 @@ fi + + if test x"$PYTHON3" = x; then + PYTHON3='@PYTHON3@' ++ ++ # PYTHONCOERCECLOCALE=0 disables the Unicode compatibility warning on ++ # stderr that breaks almost any Python3 test (PEP 0538) ++ PYTHONCOERCECLOCALE=0 ++ export PYTHONCOERCECLOCALE + fi + + PYTHONPATH=$abs_top_srcdir/python:$abs_top_builddir/tests:$PYTHONPATH +-- +2.13.0 +