diff --git a/00188-fix-lib2to3-tests-when-hashlib-doesnt-compile-properly.patch b/00188-fix-lib2to3-tests-when-hashlib-doesnt-compile-properly.patch new file mode 100644 index 0000000..90af30d --- /dev/null +++ b/00188-fix-lib2to3-tests-when-hashlib-doesnt-compile-properly.patch @@ -0,0 +1,11 @@ +diff -r 28c04e954bb6 Lib/lib2to3/main.py +--- a/Lib/lib2to3/main.py Tue Oct 29 22:25:55 2013 -0400 ++++ b/Lib/lib2to3/main.py Wed Nov 06 14:33:07 2013 +0100 +@@ -213,6 +213,7 @@ + + # Set up logging handler + level = logging.DEBUG if options.verbose else logging.INFO ++ logging.root.handlers = [] + logging.basicConfig(format='%(name)s: %(message)s', level=level) + logger = logging.getLogger('lib2to3.main') + diff --git a/python3.spec b/python3.spec index d792c03..e2fae48 100644 --- a/python3.spec +++ b/python3.spec @@ -612,6 +612,21 @@ Patch186: 00186-dont-raise-from-py_compile.patch # Temporarily add this upstream patch, should be in next upstream release Patch187: 00187-remove-pthread-atfork.patch +# 00188 # +# Downstream only patch that should be removed when we compile all guaranteed +# hashlib algorithms properly. The problem is this: +# - during tests, test_hashlib is imported and executed before test_lib2to3 +# - if at least one hash function has failed, trying to import it triggers an +# exception that is being caught and exception is logged: +# http://hg.python.org/cpython/file/2de806c8b070/Lib/hashlib.py#l217 +# - logging the exception makes logging module run basicConfig +# - when lib2to3 tests are run again, lib2to3 runs basicConfig again, which +# doesn't do anything, because it was run previously +# (logging.root.handlers != []), which means that the default setup +# (most importantly logging level) is not overriden. That means that a test +# relying on this will fail (test_filename_changing_on_output_single_dir) +Patch188: 00188-fix-lib2to3-tests-when-hashlib-doesnt-compile-properly.patch + # (New patches go here ^^^) # @@ -872,6 +887,7 @@ done # 00185 upstream as of Python 3.4.0a4 %patch186 -p1 %patch187 -p1 +%patch188 -p1 # Currently (2010-01-15), http://docs.python.org/library is for 2.6, and there # are many differences between 2.6 and the Python 3 library.