summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Doc/library/os.rst4
-rwxr-xr-xLib/test/test_array.py9
-rw-r--r--Lib/test/test_threading.py6
3 files changed, 15 insertions, 4 deletions
diff --git a/Doc/library/os.rst b/Doc/library/os.rst
index 82a5b98..81a3f35 100644
--- a/Doc/library/os.rst
+++ b/Doc/library/os.rst
@@ -1389,6 +1389,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.
diff --git a/Lib/test/test_array.py b/Lib/test/test_array.py
index 5b6b9f2..ff9026a 100755
--- a/Lib/test/test_array.py
+++ b/Lib/test/test_array.py
@@ -964,20 +964,21 @@ class DoubleTest(FPTest):
minitemsize = 8
def test_alloc_overflow(self):
+ from sys import maxsize
a = array.array('d', [-1]*65536)
try:
- a *= 65536
+ a *= maxsize//65536 + 1
except MemoryError:
pass
else:
- self.fail("a *= 2**16 didn't raise MemoryError")
+ self.fail("Array of size > maxsize created - MemoryError expected")
b = array.array('d', [ 2.71828183, 3.14159265, -1])
try:
- b * 1431655766
+ b * (maxsize//3 + 1)
except MemoryError:
pass
else:
- self.fail("a * 1431655766 didn't raise MemoryError")
+ self.fail("Array of size > maxsize created - MemoryError expected")
tests.append(DoubleTest)
diff --git a/Lib/test/test_threading.py b/Lib/test/test_threading.py
index a7f2322..f26e7bb 100644
--- a/Lib/test/test_threading.py
+++ b/Lib/test/test_threading.py
@@ -397,6 +397,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():