Add a temporary workaround for lib2to3 tests failure (to be removed when we figure out things about hashlib+fips patch)

This commit is contained in:
Bohuslav Kabrda 2013-11-06 14:58:05 +01:00
parent dfb79526a3
commit 0153564bb6
2 changed files with 27 additions and 0 deletions

View File

@ -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')

View File

@ -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.