]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Works around issue3863: freebsd4/5/6 and os2emx are known to have OS bugs when
authorGregory P. Smith <greg@mad-scientist.com>
Tue, 30 Sep 2008 20:41:13 +0000 (20:41 +0000)
committerGregory P. Smith <greg@mad-scientist.com>
Tue, 30 Sep 2008 20:41:13 +0000 (20:41 +0000)
calling fork() from a child thread.  This disables that unit test (with a note
printed to stderr) on those platforms.

A caveat about buggy platforms is added to the os.fork documentation.

Doc/library/os.rst
Lib/test/test_threading.py
Misc/NEWS

index c223e549b74931bd99bd16fee02a1b6b26121e4c..14784fad663eb9073e9255b308644a5a8bfa39a4 100644 (file)
@@ -1646,6 +1646,10 @@ written in Python, such as a mail server's external command delivery program.
 
    Fork a child process.  Return ``0`` in the child and the child's process id in the
    parent.  If an error occurs :exc:`OSError` is raised.
+
+   Note that some platforms including FreeBSD <= 6.3, Cygwin and OS/2 EMX have
+   known issues when using fork() from a thread.
+
    Availability: Unix.
 
 
index 4e8743700e65bddfc81609bbe378fc5aeec61b47..c8f9cac8f9c5f583833cc1b6bf4d8b37c3163c11 100644 (file)
@@ -380,6 +380,12 @@ class ThreadJoinOnShutdown(unittest.TestCase):
         import os
         if not hasattr(os, 'fork'):
             return
+        # Skip platforms with known problems forking from a worker thread.
+        # See http://bugs.python.org/issue3863.
+        if sys.platform in ('freebsd4', 'freebsd5', 'freebsd6', 'os2emx'):
+            print >>sys.stderr, ('Skipping test_3_join_in_forked_from_thread'
+                                 ' due to known OS bugs on'), sys.platform
+            return
         script = """if 1:
             main_thread = threading.current_thread()
             def worker():
index 1b08d76bd968832be40ce05a2a876d497ee57721..6e6c58d0f21d8f72e03a48fe2ba5f571bb8f9ba9 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -37,6 +37,9 @@ Library
 
 - Issue #3879: A regression in urllib.getproxies_enviroment was fixed.
 
+- Issue #3863: Disabled a unit test of fork being called from a thread
+  when running on platforms known to exhibit OS bugs when attempting that.
+
 Build
 -----