20984445 Python 3.4 test_site fails if certain packages are installed s11-update
authorJohn Beck <John.Beck@Oracle.COM>
Wed, 29 Apr 2015 15:22:23 -0700
branchs11-update
changeset 4229 847254ab97d9
parent 4228 52da6acd4360
child 4232 046fd454c101
20984445 Python 3.4 test_site fails if certain packages are installed
components/python/python34/patches/25-test_site.patch
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/python/python34/patches/25-test_site.patch	Wed Apr 29 15:22:23 2015 -0700
@@ -0,0 +1,24 @@
+This patch came from in-house.  A patch to make -I imply -S was submitted
+upstream, but rejected, so this is the next simplest way to work around
+issues with when the site module is imported.
+
+--- Python-3.4.3/Lib/test/test_site.py.~1~	2015-02-25 03:27:45.000000000 -0800
++++ Python-3.4.3/Lib/test/test_site.py	2015-04-29 14:49:38.712481718 -0700
[email protected]@ -436,7 +436,7 @@
+     def test_startup_imports(self):
+         # This tests checks which modules are loaded by Python when it
+         # initially starts upon startup.
+-        popen = subprocess.Popen([sys.executable, '-I', '-v', '-c',
++        popen = subprocess.Popen([sys.executable, '-I', '-S', '-v', '-c',
+                                   'import sys; print(set(sys.modules))'],
+                                  stdout=subprocess.PIPE,
+                                  stderr=subprocess.PIPE)
[email protected]@ -445,8 +445,6 @@
+         stderr = stderr.decode('utf-8')
+         modules = eval(stdout)
+ 
+-        self.assertIn('site', modules)
+-
+         # http://bugs.python.org/issue19205
+         re_mods = {'re', '_sre', 'sre_compile', 'sre_constants', 'sre_parse'}
+         # _osx_support uses the re module in many placs