Thomas Heller [Tue, 19 Aug 2008 17:17:37 +0000 (17:17 +0000)]
issue #3554: ctypes.string_at and ctypes.wstring_at must use the
pythonapi calling convention so that the GIL is held and error return
values are checked.
Issue #2234: distutils failed with mingw binutils 2.18.50.20080109.
Be less strict when parsing these version numbers,
they don't necessarily follow the python numbering scheme.
Gregory P. Smith [Sun, 17 Aug 2008 23:06:19 +0000 (23:06 +0000)]
Backport of r64767 from trunk
Fixes Issue #3309: Fix bz2.BZFile iterator to release its internal lock
properly when raising an exception due to the bz2file being closed.
Prevents a deadlock.
Gregory P. Smith [Sun, 17 Aug 2008 23:01:11 +0000 (23:01 +0000)]
Backport of r65032 from trunk
Fixes Issue #874900: after an os.fork() call the threading module state is cleaned
up in the child process to prevent deadlock and report proper thread counts
if the new process uses the threading module.
- PC/VC6/_bsddb.dsp:
removed '/nodefaultlib:"msvcrt"' to fix linker error.
- PC/VC6/_msi.dsp:
added new module support.
- PC/VC6/_sqlite3.dsp:
/D "MODULE_NAME=\"sqlite3\""
caused extra leading space like
#define MODULE_NAME " sqlite3"
so uses
/D MODULE_NAME=\"sqlite3\"
instead.
- PC/VC6/python.dsp:
changed stack size to 2MB to avoid stack overflow on
some tests.
(backport of r61652 and r61665 from trunk)
Issue #1471: Arguments to fcntl.ioctl are no longer broken on 64-bit OpenBSD
and similar platforms due to sign extension.
(backport r65459 from trunk)
- Issue #1857: subprocess.Popen.poll gained an additional _deadstate keyword
argument in python 2.5, this broke code that subclassed Popen to include its
own poll method. Fixed my moving _deadstate to an _internal_poll method.
Issue #2620: Overflow checking when allocating or reallocating memory
was not always being done properly in some python types and extension
modules. PyMem_MALLOC, PyMem_REALLOC, PyMem_NEW and PyMem_RESIZE have
all been updated to perform better checks and places in the code that
would previously leak memory on the error path when such an allocation
failed have been fixed.
Backport r62627 + r62744 from trunk to fix issue 2632.
- Issue #2632: Prevent socket.read(bignumber) from over allocating memory
in the common case when the data is returned from the underlying socket
in increments much smaller than bignumber.
#Issue3088 in-progress: Race condition with instances of classes derived from threading.local:
When a thread touches such an object for the first time, a new thread-local __dict__ is created,
and the __init__ method is run.
But a thread switch can occur here; if the other thread touches the same object, it installs another
__dict__; when the first thread resumes, it updates the dictionary of the second...
This is the deep cause of the failures in test_multiprocessing involving "managers" objects.
Issue 3110: Crash with weakref subclass,
seen after a "import multiprocessing.reduction"
An instance of a weakref subclass can have attributes.
If such a weakref holds the only strong reference to the object,
deleting the weakref will delete the object. In this case,
the callback must not be called, because the ref object is being deleted!
- Issue #1686386: Tuple's tp_repr did not take into account the possibility of
having a self-referential tuple, which is possible from C code. Nor did
object's tp_str consider that a type's tp_str could do something that could
lead to an inifinite recursion. Py_ReprEnter() and Py_EnterRecursiveCall(),
respectively, fixed the issues. (Backport of r58288 from trunk to 2.5.)
Prevent PyString_FromStringAndSize() from passing negative sizes on to lower
level memory allocation functions. Raise a SystemError and return NULL
instead.
Remove the advertising clause from the BSD license in timing.h.
I have the email trail to prove that George Neville-Neil approved this.
(Backport of r62097.)
Mark Dickinson [Tue, 25 Mar 2008 18:58:13 +0000 (18:58 +0000)]
Issue #2482: Make sure that the coefficient of a Decimal instance
is stored as a str instance rather than a unicode instance.
Backported from Python 2.6 (see r61904).
#1477: ur'\U0010FFFF' used to raise in narrow unicode builds.
Corrected the raw-unicode-escape codec to use UTF-16 surrogates in
this case, like the unicode-escape codec does.
Gregory P. Smith [Tue, 18 Mar 2008 19:21:40 +0000 (19:21 +0000)]
Backport r61450 from trunk:
Fix chown on 64-bit linux. It needed to take a long (64-bit on 64bit linux) as
uid and gid input to accept values >=2**31 as valid while still accepting
negative numbers to pass -1 to chown for "no change".
Trent Nelson [Tue, 18 Mar 2008 07:32:47 +0000 (07:32 +0000)]
The behaviour of winsound.Beep() seems to differ between different versions of Windows when there's either:
a) no sound card entirely
b) legacy beep driver has been disabled
c) the legacy beep driver has been uninstalled
Sometimes RuntimeErrors are raised, sometimes they're not. If _have_soundcard() returns False, don't expect winsound.Beep() to raise a RuntimeError, as this clearly isn't the case, as demonstrated by the various Win32 XP buildbots.
Neal Norwitz [Tue, 18 Mar 2008 04:17:36 +0000 (04:17 +0000)]
Backport r61458:
Issue 2321: reduce memory usage (increase the memory that is returned
to the system) by using pymalloc for the data of unicode objects.
#1291: copy test_resource.py from the 2.6 trunk, to fix a test failure.
The 2.6 version also converts to unittest, but it seems to work fine under 2.5.