cpython/Lib
Thomas Wouters c4dcb3801e Fix issue #1590864, multiple threads and fork() can cause deadlocks, by
acquiring the import lock around fork() calls. This prevents other threads
from having that lock while the fork happens, and is the recommended way of
dealing with such issues. There are two other locks we care about, the GIL
and the Thread Local Storage lock. The GIL is obviously held when calling
Python functions like os.fork(), and the TLS lock is explicitly reallocated
instead, while also deleting now-orphaned TLS data.

This only fixes calls to os.fork(), not extension modules or embedding
programs calling C's fork() directly. Solving that requires a new set of API
functions, and possibly a rewrite of the Python/thread_*.c mess. Add a
warning explaining the problem to the documentation in the mean time.

This also changes behaviour a little on AIX. Before, AIX (but only AIX) was
getting the import lock reallocated, seemingly to avoid this very same
problem. This is not the right approach, because the import lock is a
re-entrant one, and reallocating would do the wrong thing when forking while
holding the import lock.

Will backport to 2.6, minus the tiny AIX behaviour change.
2009-09-16 19:55:54 +00:00
..
bsddb Issue #5341: Fix a variety of spelling errors. 2009-02-21 20:27:01 +00:00
compiler Allow multiple context managers in one with statement, as proposed 2009-05-25 21:02:56 +00:00
ctypes Revert rev 74134, as it does not completely fixx issue #6493. 2009-07-21 19:04:02 +00:00
curses Issue #3239. Differentiate the ascii call from the curses one and 2008-07-05 20:39:59 +00:00
distutils Update distutils.util tests after my changes 2009-09-15 21:24:07 +00:00
email #2622 Import errors in email.message, from a py2app standalone application. 2009-07-11 14:33:51 +00:00
encodings #1616979: Add the cp720 (Arabic DOS) encoding. 2009-07-13 20:01:11 +00:00
hotshot Added warning for the removal of 'hotshot' in Py3k. 2008-03-22 04:08:44 +00:00
idlelib Issue #3926: Fix the usage of the new showwarnings and formatwarning. 2009-08-14 14:03:07 +00:00
importlib Fix some more bugs caused by the backport from 3.x for importlib. 2009-03-04 01:00:53 +00:00
json convert usage of fail* to assert* 2009-06-30 22:57:08 +00:00
lib-tk Added missing static option for OptionMenu. Issue #5961. 2009-08-18 16:39:36 +00:00
lib2to3 Merged revisions 74121-74122 via svnmerge from 2009-07-20 21:09:45 +00:00
logging Issue #6314: logging: Extra checks on the "level" argument in more places. 2009-07-13 11:21:05 +00:00
msilib Support AMD64 in msilib. Set Win64 on reglocator. 2009-06-12 17:28:31 +00:00
multiprocessing Fix issue 4660: spurious task_done errors in multiprocessing, remove doc note for from_address 2009-08-06 02:05:56 +00:00
plat-aix3
plat-aix4
plat-atheos
plat-beos5
plat-darwin
plat-freebsd4
plat-freebsd5
plat-freebsd6
plat-freebsd7
plat-freebsd8
plat-generic
plat-irix5 Deprecate WAIT for removal in 3.0. 2008-05-15 04:17:35 +00:00
plat-irix6 Deprecate WAIT for removal in 3.0. 2008-05-15 04:17:35 +00:00
plat-linux2
plat-mac Fix for issue 4937 2009-09-06 12:23:18 +00:00
plat-netbsd1
plat-next3
plat-os2emx #2503 make singletons compared with "is" not == or != 2008-03-29 15:24:25 +00:00
plat-riscos Patch #2167 from calvin: Remove unused imports 2008-02-23 17:40:11 +00:00
plat-sunos5 Deprecate sunaudiodev/SUNAUDIODEV for removal in 3.0. 2008-05-16 00:10:24 +00:00
plat-unixware7
pydoc_data Update pydoc topics. 2009-04-26 09:57:29 +00:00
site-packages
sqlite3 #6026 - fix tests that failed without zlib 2009-09-12 14:43:43 +00:00
test Fix issue #1590864, multiple threads and fork() can cause deadlocks, by 2009-09-16 19:55:54 +00:00
unittest Test discovery in unittest will only attempt to import modules that are importable; i.e. their names are valid Python identifiers. If an import fails during discovery this will be recorded as an error and test discovery will continue. Issue 6568. 2009-09-13 19:07:03 +00:00
wsgiref #2622 Import errors in email.message, from a py2app standalone application. 2009-07-11 14:33:51 +00:00
xml #4490 Fix sample code run by "python -m xml.sax.xmlreader" 2009-06-22 19:33:48 +00:00
BaseHTTPServer.py http://bugs.python.org/issue6267 2009-06-28 21:04:17 +00:00
Bastion.py Deprecate Bastion and rexec for 3.0. 2008-05-10 02:27:04 +00:00
CGIHTTPServer.py docstring update. 2009-05-03 20:27:25 +00:00
ConfigParser.py #5741 followup: should also allow %%(blah)s. 2009-04-13 12:36:24 +00:00
Cookie.py Issue #5275: In Cookie's Cookie.load(), properly handle non-string arguments as documented. 2009-09-04 08:17:04 +00:00
DocXMLRPCServer.py http://bugs.python.org/issue6267 2009-06-28 21:04:17 +00:00
HTMLParser.py revert creation of the html.entities and html.parser modules 2008-05-20 06:08:38 +00:00
MimeWriter.py
Queue.py Move the previously local import of threading to module level. 2009-03-15 22:11:07 +00:00
SimpleHTTPServer.py Issue839496: SimpleHTTPServer should open all files in binary mode. 2008-07-06 21:34:39 +00:00
SimpleXMLRPCServer.py Issue 6654 2009-08-27 23:13:18 +00:00
SocketServer.py http://bugs.python.org/issue6382 2009-07-07 09:01:34 +00:00
StringIO.py
UserDict.py Register IterableUserDict as a MutableMapping. 2008-06-07 16:16:12 +00:00
UserList.py Issue 2235: Py3k warnings are now emitted for classes that will no longer inherit a__hash__ implementation from a parent class in Python 3.x. The standard library and test suite have been updated to not emit these warnings. 2008-08-11 15:45:58 +00:00
UserString.py Issue 2235: __hash__ is once again inherited by default, but inheritance can be blocked explicitly so that collections.Hashable remains meaningful 2008-07-15 14:27:37 +00:00
_LWPCookieJar.py
_MozillaCookieJar.py
__future__.py Patch #2477: Added from __future__ import unicode_literals 2008-03-26 22:01:37 +00:00
__phello__.foo.py
_abcoll.py Issue 6037: MutableSequence.__iadd__ should return self. 2009-05-18 15:51:59 +00:00
_pyio.py Issue #6215: backport the 3.1 io lib 2009-06-12 20:14:08 +00:00
_strptime.py add %f format to datetime - issue 1158 2008-03-15 16:04:45 +00:00
_threading_local.py give the threading API PEP 8 names 2008-06-11 17:27:50 +00:00
abc.py Fix typos. 2009-05-04 16:03:03 +00:00
aifc.py Issue5955: aifc's close method did not close the file it wrapped, 2009-05-07 16:27:02 +00:00
antigravity.py easter egg 2008-10-15 11:49:10 +00:00
anydbm.py
ast.py ast.literal_eval can properly evaluate complex numbers now. This fixes issue4907. 2009-01-13 11:52:23 +00:00
asynchat.py warnings.catch_warnings() now returns a list or None instead of the custom 2008-09-09 00:49:16 +00:00
asyncore.py Fix for line wrap ugly. 2009-06-03 19:51:52 +00:00
atexit.py
audiodev.py Deprecate the audiodev module for 3.0. 2008-05-06 23:23:34 +00:00
base64.py
bdb.py #5142: add module skipping feature to pdb. 2009-05-05 08:54:11 +00:00
binhex.py
bisect.py Per the language summit, the optional fastpath imports should use from-import-star. 2009-03-31 17:47:06 +00:00
cProfile.py
calendar.py Remove some from __future__ import with_statements 2008-04-30 21:25:55 +00:00
cgi.py #4351: more appropriate DeprecationWarning stacklevels 2009-05-08 02:28:39 +00:00
cgitb.py #602893: add indicator for current line in cgitb that doesnt rely on styling alone. 2009-04-05 18:34:58 +00:00
chunk.py
cmd.py
code.py #1288615: Python code.interact() and non-ASCII input 2008-08-07 18:42:40 +00:00
codecs.py Merged revisions 61750,61752,61754,61756,61760,61763,61768,61772,61775,61805,61809,61812,61819,61917,61920,61930,61933-61934 via svnmerge from 2008-03-26 12:49:49 +00:00
codeop.py
collections.py Issue 6370: Performance issue with collections.Counter(). 2009-06-29 19:10:29 +00:00
colorsys.py pep8tify conditionals 2009-01-30 02:02:25 +00:00
commands.py #4351: more appropriate DeprecationWarning stacklevels 2009-05-08 02:28:39 +00:00
compileall.py Automatic conversion of floats to integers for struct.pack integer codes 2009-04-19 17:10:47 +00:00
contextlib.py Remove markup from docstring 2009-06-23 10:51:02 +00:00
cookielib.py Update __all__ for cookielib, csv, os, and urllib2 for objects imported into 2008-08-18 00:46:22 +00:00
copy.py Issue #2116: Weak references and weak dictionaries now support copy()ing and deepcopy()ing. 2009-05-15 16:54:52 +00:00
copy_reg.py Revert copy_reg -> copyreg rename. 2008-05-20 07:49:57 +00:00
csv.py Update __all__ for cookielib, csv, os, and urllib2 for objects imported into 2008-08-18 00:46:22 +00:00
dbhash.py Deprecate bsddb for removal in Python 3.0. 2008-09-05 18:33:51 +00:00
decimal.py Issue #6857: Fix Decimal formatting to be consistent with existing float 2009-09-08 20:20:19 +00:00
difflib.py Issue #5341: Fix a variety of spelling errors. 2009-02-21 20:27:01 +00:00
dircache.py Deprecate the dircache module for 3.0. 2008-05-10 21:12:57 +00:00
dis.py use isinstance 2009-05-10 14:16:47 +00:00
doctest.py Stronger tests for combinatoric relationships. 2009-01-27 09:52:35 +00:00
dumbdbm.py
dummy_thread.py Remove imports of 'warnings' that are no longer needed in dummy_thread, 2008-08-17 22:10:11 +00:00
dummy_threading.py
filecmp.py use multi-with syntax 2009-06-11 17:51:17 +00:00
fileinput.py Remove a use of callable() in fileinput to silence a -3 warning. 2008-08-03 23:52:32 +00:00
fnmatch.py Issue 6665: Fix fnmatch to properly match filenames with newlines in them. 2009-08-16 18:52:58 +00:00
formatter.py #1726198: replace while 1: fp.readline() with file iteration. 2008-01-21 17:22:06 +00:00
fpformat.py Deprecate the fpformat module for removal in 3.0. 2008-05-10 22:11:45 +00:00
fractions.py Issue #6431: Fix Fraction comparisons with unknown types, and with 2009-07-18 15:18:18 +00:00
ftplib.py #1726172: dont raise an unexpected IndexError if a voidresp() call has an empty response. 2009-04-05 10:48:47 +00:00
functools.py Copy reduce() to _functools so to have functools.reduce() not raise a warning 2008-08-09 23:30:55 +00:00
genericpath.py
getopt.py #4458: recognize "-" as an argument, not a malformed option in gnu_getopt(). 2008-12-05 09:23:14 +00:00
getpass.py Major improvements: 2008-04-22 08:08:41 +00:00
gettext.py close file explicitly 2009-05-10 01:38:02 +00:00
glob.py #5655: fix docstring oversight. 2009-04-01 17:46:01 +00:00
gzip.py #4351: more appropriate DeprecationWarning stacklevels 2009-05-08 02:28:39 +00:00
hashlib.py Clean up the C library import code (based on suggestions in issue6281). 2009-08-16 21:54:45 +00:00
heapq.py Make life easier for non-CPython implementations. 2009-03-29 18:51:11 +00:00
hmac.py silence callable warning in hmac 2008-08-19 19:07:38 +00:00
htmlentitydefs.py revert creation of the html.entities and html.parser modules 2008-05-20 06:08:38 +00:00
htmllib.py Deprecate htmllib and sgmllib for 3.0. 2008-06-01 21:19:14 +00:00
httplib.py Fixes issue #6838: use a list to accumulate the value instead of repeatedly concatenating strings. 2009-09-04 16:12:32 +00:00
ihooks.py Deprecate ihooks for removal in 3.0. 2008-05-10 22:45:07 +00:00
imaplib.py Issue #1655: Make imaplib IPv6-capable. Patch by Derek Morr. 2009-05-15 11:50:29 +00:00
imghdr.py #3424 rearrange the order of tests in imghdr to place more common types first 2008-08-16 16:29:02 +00:00
imputil.py #6224: s/JPython/Jython/, and remove one link to a module nine years old. 2009-06-06 18:21:58 +00:00
inspect.py Issue #6619: Remove duplicate 'isgenerator' function from inspect module. 2009-08-02 15:40:11 +00:00
io.py Issue #6215: backport the 3.1 io lib 2009-06-12 20:14:08 +00:00
keyword.py #1726198: replace while 1: fp.readline() with file iteration. 2008-01-21 17:22:06 +00:00
linecache.py #1309567: fix linecache behavior of stripping subdirectories from paths when looking for relative filename matches. Also add a linecache test suite. 2009-05-05 08:28:49 +00:00
locale.py Issue #6620: Slightly safer code for _grouping_intervals in the locale 2009-08-04 21:56:04 +00:00
macpath.py #4351: more appropriate DeprecationWarning stacklevels 2009-05-08 02:28:39 +00:00
macurl2path.py
mailbox.py #1607951: Make mailbox.Maildir re-read the directories less frequently. 2009-05-02 19:17:28 +00:00
mailcap.py
markupbase.py
md5.py
mhlib.py Deprecated the mhlib module for removal in 3.0. 2008-05-11 03:01:47 +00:00
mimetools.py warnings.catch_warnings() now returns a list or None instead of the custom 2008-09-09 00:49:16 +00:00
mimetypes.py Issue #5853: calling a function of the mimetypes module from several threads 2009-04-27 20:50:20 +00:00
mimify.py
modulefinder.py Fixed a modulefinder crash on certain relative imports. 2008-10-30 20:18:13 +00:00
multifile.py Deprecate the multifile module as per PEP 4. 2008-05-12 03:19:20 +00:00
mutex.py use True and False 2009-01-27 23:15:48 +00:00
netrc.py explicitly close the file, merged from py3k 2009-05-28 03:10:59 +00:00
new.py restricted environments are no more 2009-08-28 16:48:03 +00:00
nntplib.py Issue #1664: Make nntplib IPv6-capable. Patch by Derek Morr. 2009-05-14 21:22:08 +00:00
ntpath.py #4351: more appropriate DeprecationWarning stacklevels 2009-05-08 02:28:39 +00:00
nturl2path.py Fixing issue5861 - test_urllib fails on windows. Agree to comment to have ':' in pathname2url as windows recognizes it. test_urllib passes now. 2009-05-05 17:34:42 +00:00
numbers.py Issue 4998: __slots__ on Fractions was useless. 2009-01-20 20:34:19 +00:00
opcode.py add a SETUP_WITH opcode 2009-05-25 13:13:44 +00:00
optparse.py #5719: add short usage example to optparse docstring. 2009-04-12 20:30:53 +00:00
os.py Avoid invoking the parser/compiler just to test the presence of a function. 2009-06-09 22:53:16 +00:00
os2emxpath.py
pdb.doc Add some sentence endings. 2008-05-11 14:17:13 +00:00
pdb.py Make the pdb displayhook compatible with the standard displayhook: do not print Nones. Add a test for that. 2009-09-16 16:36:39 +00:00
pickle.py Isue #5084: unpickling now interns the attribute names of pickled objects, 2009-05-02 21:13:23 +00:00
pickletools.py Issue 6066: POP_MARK was not in pickle protocol 0. 2009-05-20 16:49:12 +00:00
pipes.py
pkgutil.py Issue 2439: add pkgutils.get_data() as a convenience wrapper for the PEP 302 get_data() API (contributed by Paul Moore) 2008-04-15 10:25:31 +00:00
platform.py Use a different VER command output parser to address the localization 2009-07-13 21:28:33 +00:00
plistlib.py #4351: more appropriate DeprecationWarning stacklevels 2009-05-08 02:28:39 +00:00
popen2.py Use os.closerange() in popen2. 2008-02-23 22:09:24 +00:00
poplib.py Fixed the semantic of timeout for socket.create_connection and 2008-05-29 16:39:26 +00:00
posixfile.py
posixpath.py #4351: more appropriate DeprecationWarning stacklevels 2009-05-08 02:28:39 +00:00
pprint.py Fixed issue #2888. Now the behaviour of pprint when working with nested 2008-06-21 17:43:56 +00:00
profile.py Issue #6635: Fix profiler printing usage message. 2009-09-13 15:09:24 +00:00
pstats.py Silence -3 warnings in pstats: a dict.has_key() usage and backport solution to 2008-08-03 22:52:42 +00:00
pty.py
py_compile.py #2225: return nonzero status code from py_compile if not all files could be compiled. 2008-03-06 07:41:16 +00:00
pyclbr.py Minor cleanups: 2008-04-28 02:57:23 +00:00
pydoc.py Fix issue 5230 by having pydoc's safeimport check to see if the import 2009-06-23 18:02:46 +00:00
quopri.py
random.py Issue 6261: Clarify behavior of random.uniform(). 2009-06-11 23:14:53 +00:00
re.py Adds an optional flags argument to re.split, re.sub and re.subn to be 2009-03-02 05:13:57 +00:00
repr.py Revert the renaming of repr to reprlib. 2008-05-23 05:03:59 +00:00
rexec.py Deprecate Bastion and rexec for 3.0. 2008-05-10 02:27:04 +00:00
rfc822.py fix test_py3kwarns 2008-07-14 17:42:17 +00:00
rlcompleter.py Remove a use of callable() to silence the warning triggered under -3. 2008-08-01 01:45:49 +00:00
robotparser.py Close issue 3437 - missing state change when Allow lines are processed. 2008-07-27 00:49:02 +00:00
runpy.py Issue 4195: Restore the ability to execute packages with the -m switch (but this time in a way that leaves the import machinery in a valid state). (Original patch by Andi Vajda) 2009-02-08 01:26:34 +00:00
sched.py #6112: list.remove raises ValueError, not RuntimeError. 2009-05-26 07:50:23 +00:00
sets.py Issue 2235: __hash__ is once again inherited by default, but inheritance can be blocked explicitly so that collections.Hashable remains meaningful 2008-07-15 14:27:37 +00:00
sgmllib.py #1651995: fix _convert_ref for non-ASCII characters. 2009-03-31 22:11:53 +00:00
sha.py
shelve.py Remove imports of 'warnings' that are no longer needed in dummy_thread, 2008-08-17 22:10:11 +00:00
shlex.py
shutil.py only test for named pipe when os.stat doesn't raise #6209 2009-06-05 19:09:28 +00:00
site.py #6693: New functions in site.py to get user/global site packages paths. 2009-08-20 21:23:13 +00:00
smtpd.py Issue #5341: Fix a variety of spelling errors. 2009-02-21 20:27:01 +00:00
smtplib.py Fix Issue #4066: smtplib.SMTP_SSL._get_socket now correctly returns 2009-05-23 00:48:58 +00:00
sndhdr.py
socket.py Fix issue1628205: Socket file objects returned by socket.socket.makefile() now 2009-08-13 18:54:50 +00:00
sre.py
sre_compile.py remove set compat cruft 2008-10-14 22:37:18 +00:00
sre_constants.py
sre_parse.py remove set compat cruft 2008-10-14 22:37:18 +00:00
ssl.py fix name collision issues 2008-12-31 04:08:55 +00:00
stat.py #2383: remove obsolete XXX comment in stat.py. 2008-03-20 07:25:55 +00:00
statvfs.py Deprecated statvfs for removal in 3.0. 2008-05-16 00:50:02 +00:00
string.py fix comment 2008-11-09 01:52:32 +00:00
stringold.py Replace all map(None, a) with list(a). 2008-07-18 19:06:13 +00:00
stringprep.py
struct.py
subprocess.py Revert r74028. 2009-07-16 21:47:51 +00:00
sunau.py
sunaudio.py Deprecate the sunaudio module for removal in Python 3.0. The sunau module can provide similar functionality. 2008-07-18 19:30:22 +00:00
symbol.py update symbol.py from with statement changes 2009-06-09 21:13:43 +00:00
symtable.py return locals and cells in get_locals() not bound globals, though 2009-06-28 19:27:55 +00:00
tabnanny.py
tarfile.py Issue #6856: Add a filter keyword argument to TarFile.add(). 2009-09-12 10:28:15 +00:00
telnetlib.py Fixed the semantic of timeout for socket.create_connection and 2008-05-29 16:39:26 +00:00
tempfile.py proxy the __exit__ call 2009-07-01 13:34:35 +00:00
textwrap.py Follow-up to r67746 in order to restore backwards-compatibility for 2008-12-27 18:27:53 +00:00
this.py
threading.py fix Thread.ident when it is the main thread or a dummy thread #5632 2009-03-31 21:34:42 +00:00
timeit.py Localize the function lookup in timeit. 2009-04-03 02:43:54 +00:00
toaiff.py Deprecate the toaiff module for removal in 3.0. 2008-05-09 05:32:42 +00:00
token.py Issue 2117. Update compiler module to handle class decorators. 2008-02-25 18:06:00 +00:00
tokenize.py Remove a tuple unpacking in a parameter list to remove a SyntaxWarning raised 2008-08-02 03:15:20 +00:00
trace.py Add a timing flag to Trace so you can see where slowness occurs 2008-02-26 08:21:28 +00:00
traceback.py #3584: ignore trailing newlines when placing the caret for a SyntaxError location. 2009-06-04 09:15:12 +00:00
tty.py
types.py remove more code for restricted execution 2009-08-28 16:49:56 +00:00
urllib.py Fix for Issue1648102, based on the MSDN spec: If this parameter specifies the 2009-05-01 05:59:52 +00:00
urllib2.py Fix for issue5102, timeout value propages between redirects, proxy, digest and 2009-07-19 02:43:43 +00:00
urlparse.py Fix for bugs: Issue4675 and Issue4962. 2009-03-30 21:51:50 +00:00
user.py Deprecate the user module for removal in 3.0. 2008-05-08 20:36:09 +00:00
uu.py
uuid.py #4363: Let uuid.uuid1() and uuid.uuid4() run even if the ctypes module is not present. 2008-11-21 22:05:48 +00:00
warnings.py Require implementations for warnings.showwarning() support the 'line' argument. 2009-03-11 04:51:06 +00:00
wave.py
weakref.py Issue #2116: Weak references and weak dictionaries now support copy()ing and deepcopy()ing. 2009-05-15 16:54:52 +00:00
webbrowser.py Issue #2666: Handle BROWSER environment variable properly for unknown browser names in the webbrowser module. 2009-09-04 06:59:20 +00:00
whichdb.py
wsgiref.egg-info
xdrlib.py
xmllib.py #4351: more appropriate DeprecationWarning stacklevels 2009-05-08 02:28:39 +00:00
xmlrpclib.py issue 6769 2009-08-24 11:39:31 +00:00
zipfile.py #6511: ZipFile will now raise BadZipfile when opening an empty or tiny file, 2009-07-28 22:15:30 +00:00