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.
Ronald Oussoren [Tue, 19 Feb 2008 15:29:40 +0000 (15:29 +0000)]
A quick fix that removes a spurious unittest failure when users
upgrade their python2.5 install and then run Python's test suite.
This is needed because one of the test files for the decimal module
changed it name (see issue 2114) and OSX doesn't feature a full
package manager.
Martin v. Löwis [Thu, 14 Feb 2008 11:26:18 +0000 (11:26 +0000)]
Added checks for integer overflows, contributed by Google. Some are
only available if asserts are left in the code, in cases where they
can't be triggered from Python code.
Kurt B. Kaiser [Thu, 14 Feb 2008 04:11:52 +0000 (04:11 +0000)]
Corrected some bugs in AutoComplete. Also, Page Up/Down in ACW implemented;
mouse and cursor selection in ACWindow implemented; double Tab inserts current
selection and closes ACW (similar to double-click and Return); scroll wheel now
works in ACW. Added AutoComplete instructions to IDLE Help.
Backport of r53679
Kurt B. Kaiser [Thu, 14 Feb 2008 04:02:10 +0000 (04:02 +0000)]
1. Avoid hang when encountering a duplicate in a completion list. Bug 1571112.
2. Duplicate some old entries from Python's NEWS to IDLE's NEWS.txt
Backport of r53042
Kurt B. Kaiser [Thu, 14 Feb 2008 03:25:59 +0000 (03:25 +0000)]
Some syntax errors were being caught by tokenize during the tabnanny
check, resulting in obscure error messages. Do the syntax check
first. Bug 1562716, 1562719 Backport of r52083
Lars Gustäbel [Mon, 11 Feb 2008 18:36:07 +0000 (18:36 +0000)]
Backport the nts() function from the trunk. This fixes problems with
the xstar format that puts extra fields inside the space that POSIX
has reserved for the prefix field.
Walter Dörwald [Thu, 7 Feb 2008 19:35:17 +0000 (19:35 +0000)]
Backport LaTeX version of r60649:
Clarify that the output of TextCalendar.formatmonth() and
TextCalendar.formatyear() for custom instances won't be influenced by calls
to the module global setfirstweekday() function. Fixes #2018.