Remove PYTHONCOERCECLOCALE=0 workaround and backport upstream patch

Resolves: #1454364
f38
Timothy Redaelli 8 years ago
parent cd5e53c2ab
commit b8d20da075

@ -30,7 +30,7 @@
Name: openvswitch Name: openvswitch
Version: 2.7.0 Version: 2.7.0
Release: 3%{?snapshot}%{?dist} Release: 4%{?snapshot}%{?dist}
Summary: Open vSwitch daemon/database/utilities Summary: Open vSwitch daemon/database/utilities
# Nearly all of openvswitch is ASL 2.0. The bugtool is LGPLv2+, and the # 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 Source2: ovs-snapshot.sh
Patch1: openvswitch-CVE-2017-9214.patch Patch1: openvswitch-CVE-2017-9214.patch
Patch2: tests-Export-PYTHONCOERCECLOCALE-0-for-python3-tests.patch
%if %{with dpdk} %if %{with dpdk}
%define dpdkarches x86_64 i686 aarch64 ppc64le %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 ./boot.sh
%endif %endif
export PYTHONCOERCECLOCALE=0
%configure \ %configure \
--enable-ssl \ --enable-ssl \
%if %{with dpdk} %if %{with dpdk}
@ -377,8 +376,6 @@ rm -f $RPM_BUILD_ROOT/%{_bindir}/ovs-benchmark \
%check %check
%if %{with check} %if %{with check}
export PYTHONCOERCECLOCALE=0
if make check TESTSUITEFLAGS='%{_smp_mflags}' || if make check TESTSUITEFLAGS='%{_smp_mflags}' ||
make check TESTSUITEFLAGS='--recheck'; then :; make check TESTSUITEFLAGS='--recheck'; then :;
else else
@ -650,6 +647,9 @@ rm -rf $RPM_BUILD_ROOT
%{_unitdir}/ovn-controller-vtep.service %{_unitdir}/ovn-controller-vtep.service
%changelog %changelog
* Wed Jun 07 2017 Timothy Redaelli <tredaelli@redhat.com> - 2.7.0-4
- Remove PYTHONCOERCECLOCALE=0 workaround and backport upstream patch (#1454364)
* Wed May 31 2017 Timothy Redaelli <tredaelli@redhat.com> - 2.7.0-3 * Wed May 31 2017 Timothy Redaelli <tredaelli@redhat.com> - 2.7.0-3
- Backport fix for CVE-2017-9214 (#1456797) - Backport fix for CVE-2017-9214 (#1456797)
- Use %%autosetup instead of %%setup - Use %%autosetup instead of %%setup

@ -0,0 +1,46 @@
From 6180d2a53ac63e9e11c945e438faffceee30f6a1 Mon Sep 17 00:00:00 2001
From: Timothy Redaelli <tredaelli@redhat.com>
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 <tredaelli@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
---
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
Loading…
Cancel
Save