]> granicus.if.org Git - python/commitdiff
Merged revisions 80108,80111,80114-80115 via svnmerge from
authorMark Dickinson <dickinsm@gmail.com>
Fri, 16 Apr 2010 16:32:49 +0000 (16:32 +0000)
committerMark Dickinson <dickinsm@gmail.com>
Fri, 16 Apr 2010 16:32:49 +0000 (16:32 +0000)
svn+ssh://pythondev@svn.python.org/python/branches/py3k

........
  r80108 | victor.stinner | 2010-04-16 13:23:43 +0100 (Fri, 16 Apr 2010) | 4 lines

  Add CS_GNU_LIBC_VERSION and CS_GNU_LIBPTHREAD_VERSION constants for constr(),
  and disable test_execvpe_with_bad_program() of test_os if the libc uses
  linuxthreads to avoid the "unknown signal 32" bug (see issue #4970).
........
  r80111 | mark.dickinson | 2010-04-16 13:47:52 +0100 (Fri, 16 Apr 2010) | 1 line

  Keep confstr entries in alphabetical order.
........
  r80114 | mark.dickinson | 2010-04-16 14:45:35 +0100 (Fri, 16 Apr 2010) | 1 line

  Issue #4970:  move linuxthreads check outside the affected test, and use skipIf
........
  r80115 | mark.dickinson | 2010-04-16 14:51:27 +0100 (Fri, 16 Apr 2010) | 1 line

  Don't assume that os.confstr_names exists.
........

Lib/test/test_os.py
Modules/posixmodule.c

index 0c8e59764119f684b0a689d44596207fd4a942bd..6134c93c9651722153245ba17f6eb8e343bd165f 100644 (file)
@@ -10,6 +10,17 @@ import sys
 import shutil
 from test import support
 
+# Detect whether we're on a Linux system that uses the (now outdated
+# and unmaintained) linuxthreads threading library.  There's an issue
+# when combining linuxthreads with a failed execv call: see
+# http://bugs.python.org/issue4970.
+if (hasattr(os, "confstr_names") and
+    "CS_GNU_LIBPTHREAD_VERSION" in os.confstr_names):
+    libpthread = os.confstr("CS_GNU_LIBPTHREAD_VERSION")
+    USING_LINUXTHREADS= libpthread.startswith("linuxthreads")
+else:
+    USING_LINUXTHREADS= False
+
 # Tests creating TESTFN
 class FileTests(unittest.TestCase):
     def setUp(self):
@@ -566,8 +577,11 @@ class URandomTests(unittest.TestCase):
             pass
 
 class ExecTests(unittest.TestCase):
+    @unittest.skipIf(USING_LINUXTHREADS,
+                     "avoid triggering a linuxthreads bug: see issue #4970")
     def test_execvpe_with_bad_program(self):
-        self.assertRaises(OSError, os.execvpe, 'no such app-', ['no such app-'], None)
+        self.assertRaises(OSError, os.execvpe, 'no such app-',
+                          ['no such app-'], None)
 
     def test_execvpe_with_bad_arglist(self):
         self.assertRaises(ValueError, os.execvpe, 'notepad', [], None)
index bba75aff486f99c39782721d816147b7c0533a93..c7e073641c78287d9a65059f48c1e4e0a6f9a690 100644 (file)
@@ -6028,6 +6028,12 @@ static struct constdef posix_constants_confstr[] = {
 #ifdef _CS_ARCHITECTURE
     {"CS_ARCHITECTURE",        _CS_ARCHITECTURE},
 #endif
+#ifdef _CS_GNU_LIBC_VERSION
+    {"CS_GNU_LIBC_VERSION",    _CS_GNU_LIBC_VERSION},
+#endif
+#ifdef _CS_GNU_LIBPTHREAD_VERSION
+    {"CS_GNU_LIBPTHREAD_VERSION",      _CS_GNU_LIBPTHREAD_VERSION},
+#endif
 #ifdef _CS_HOSTNAME
     {"CS_HOSTNAME",    _CS_HOSTNAME},
 #endif