[Python-checkins] r66703 - in python/trunk: Doc/library/os.rst Lib/test/test_threading.py Misc/NEWS

gregory.p.smith python-checkins at python.org
Tue Sep 30 22:41:13 CEST 2008


Author: gregory.p.smith
Date: Tue Sep 30 22:41:13 2008
New Revision: 66703

Log:
Works around issue3863: freebsd4/5/6 and os2emx are known to have OS bugs when
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.


Modified:
   python/trunk/Doc/library/os.rst
   python/trunk/Lib/test/test_threading.py
   python/trunk/Misc/NEWS

Modified: python/trunk/Doc/library/os.rst
==============================================================================
--- python/trunk/Doc/library/os.rst	(original)
+++ python/trunk/Doc/library/os.rst	Tue Sep 30 22:41:13 2008
@@ -1646,6 +1646,10 @@
 
    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.
 
 

Modified: python/trunk/Lib/test/test_threading.py
==============================================================================
--- python/trunk/Lib/test/test_threading.py	(original)
+++ python/trunk/Lib/test/test_threading.py	Tue Sep 30 22:41:13 2008
@@ -380,6 +380,12 @@
         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():

Modified: python/trunk/Misc/NEWS
==============================================================================
--- python/trunk/Misc/NEWS	(original)
+++ python/trunk/Misc/NEWS	Tue Sep 30 22:41:13 2008
@@ -37,6 +37,9 @@
 
 - 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
 -----
 


More information about the Python-checkins mailing list