krb5 commit: Require Python 3.2.4 for test scripts

Greg Hudson ghudson at mit.edu
Fri Aug 2 15:53:22 EDT 2019


https://github.com/krb5/krb5/commit/dd402f9f868da110df64db42ec10335d7c96d14f
commit dd402f9f868da110df64db42ec10335d7c96d14f
Author: Greg Hudson <ghudson at mit.edu>
Date:   Thu Aug 1 17:55:42 2019 -0400

    Require Python 3.2.4 for test scripts
    
    In Python 3 releases before 3.2.4, the subprocess.Popen.communicate
    method does not accept string inputs when universal_newlines=True is
    set (see https://bugs.python.org/issue16903).
    
    Also substitute the minimum Python version displayed by "make
    check-pytests-no" from configure.ac to help keep it in sync with the
    minimum version we check for.

 src/Makefile.in  |    3 ++-
 src/configure.ac |    8 ++++++--
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/src/Makefile.in b/src/Makefile.in
index 31135ff..691f86c 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -494,8 +494,9 @@ check-prerecurse: runenv.py
 check-unix: check-lmdb-$(HAVE_LMDB)
 	cat $(SKIPTESTS)
 
+MINPYTHON = @PYTHON_MINVERSION@
 check-pytests-no: check-postrecurse
-	@echo 'Skipped python test scripts: python 3 required' >> \
+	@echo 'Skipped python test scripts: python $(MINPYTHON) required' >> \
 		$(SKIPTESTS)
 
 check-cmocka-no: check-postrecurse
diff --git a/src/configure.ac b/src/configure.ac
index b7198c2..171bad4 100644
--- a/src/configure.ac
+++ b/src/configure.ac
@@ -1142,14 +1142,18 @@ else
 fi
 AC_SUBST(HAVE_RUNTEST)
 
-# For Python tests.
+# For Python tests.  Python version 3.2.4 is required as prior
+# versions do not accept string input to subprocess.Popen.communicate
+# when universal_newlines is set.
+PYTHON_MINVERSION=3.2.4
+AC_SUBST(PYTHON_MINVERSION)
 AC_CHECK_PROG(PYTHON,python3,python3)
 if test x"$PYTHON" = x; then
 	AC_CHECK_PROG(PYTHON,python,python)
 fi
 HAVE_PYTHON=no
 if test x"$PYTHON" != x; then
-	wantver="(sys.hexversion >= 0x3000000)"
+	wantver="(sys.hexversion >= 0x30204F0)"
 	if "$PYTHON" -c "import sys; sys.exit(not $wantver and 1 or 0)"; then
 		HAVE_PYTHON=yes
 	fi


More information about the cvs-krb5 mailing list