| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
| |
[ 529104 ] broken error handling in unicode-escape
I presume this will need to be fixed on the trunk, too.
Later.
|
|
|
|
|
|
|
|
| |
[ 531306 ] ucs4 build horked.
Classic C mistake, I think.
Also squashed a couple of warnings in the ucs4 build.
|
|
|
|
|
|
|
|
|
|
|
| |
The proper fix is not quite what was submitted; it's really better to
take the class of the object passed rather than calling PyMethod_New
with NULL pointer args, because that can then cause other core dumps
later.
I also added a testcase for the fix to classmethods() in test_descr.py.
I'll apply this to 2.3 too.
|
|
|
|
|
| |
Change the way __doc__ is handled, to avoid blowing up on non-string
__doc__ values.
|
| |
|
|
|
|
|
| |
"cvs diff | patch" managed to stick the NEWS item in the 2.2 final
section! I wonder which silly man wrote patch <wink>.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
revision 2.129 of typeobject.c
"Fix" for SF bug #520644: __slots__ are not pickled.
As promised in my response to the bug report, I'm not really fixing
it; in fact, one could argule over what the proper fix should do.
Instead, I'm adding a little magic that raises TypeError if you try to
pickle an instance of a class that has __slots__ but doesn't define or
override __getstate__. This is done by adding a bozo __getstate__
that always raises TypeError.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
revision 2.41 of moduleobject.c
Fix for SF bug #529050 - ModuleType.__new__ crash.
There were several places that assumed the md_dict field was always
set, but it needn't be. Fixed these to be more careful.
I changed PyModule_GetDict() to initialize md_dict to a new dictionary
if it's NULL.
Bugfix candidate.
|
|
|
|
|
|
|
|
|
|
|
| |
free" glitch).
unicodeobject.c: squash compiler warnings.
Noting that test_pyclbr currently fails in 2.2.1:
test_others (__main__.PyclbrTest) ... ??? HTTP11
FAIL
|
|
|
|
|
|
|
|
|
|
| |
revision 2.128 of typeobject.c
Bugfix candidate.
Adapter from SF patch 528038; fixes SF bug 527816.
The wrapper for __nonzero__ should be wrap_inquiry rather than
wrap_unaryfunc, since the slot returns an int, not a PyObject *.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
revision 2.111 of floatobject.c
SF bug 525705: [2.2] underflow raise OverflowException.
Another year in the quest to out-guess random C behavior.
Added macros Py_ADJUST_ERANGE1(X) and Py_ADJUST_ERANGE2(X, Y). The latter
is useful for functions with complex results. Two corrections to errno-
after-libm-call are attempted:
1. If the platform set errno to ERANGE due to underflow, clear errno.
Some unknown subset of libm versions and link options do this. It's
allowed by C89, but I never figured anyone would do it.
2. If the platform did not set errno but overflow occurred, force
errno to ERANGE. C89 required setting errno to ERANGE, but C99
doesn't. Some unknown subset of libm versions and link options do
it the C99 way now.
Bugfix candidate, but hold off until some Linux people actually try it,
with and without -lieee. I'll send a help plea to Python-Dev.
|
|
|
|
|
|
|
|
|
|
| |
backport jhylton's checkin of
revision 2.98 of abstract.c
Fix leak of NotImplemented in previous checkin to PyNumber_Add().
If result == Py_NotImplemented, always DECREF it before assigning a
new value to result.
|
|
|
|
|
|
|
|
|
|
| |
revision 2.97 of abstract.c
Fix for SF bug 516727: MyInt(2) + "3" -> NotImplemented
PyNumber_Add() tries the nb_add slot first, then falls back to
sq_concat. However, it didn't check the return value of sq_concat.
If sq_concat returns NotImplemented, raise the standard TypeError.
|
|
|
|
|
|
| |
revision 1.6 of structseq.c
Guido pointed out that I was missing a couple decrefs.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
the branch. I don't think it can break code, so the only risk
is introducing new bugs. In that vein, can I ask -checkins readers
who have time to carefully look this over, check my refcounts &c?
TIA.
backport my checkin of
revision 1.5 of structseq.c
Apply (my) patch:
[ 526072 ] pickling os.stat results round II
structseq's constructors can now take "invisible" fields in a dict.
Gave the constructors better error messages.
their __reduce__ method puts these fields in a dict.
(this is all in aid of getting os.stat_result's to pickle portably)
Also fixes
[ 526039 ] devious code can crash structseqs
Thought needed about how much of this counts as a bugfix. Certainly
#526039 needs to be fixed.
|
|
|
|
|
|
|
|
|
| |
revision 1.114 of longobject.c
_PyLong_Copy(): was creating a copy of the absolute value, but should
copy the sign too. Added a test to test_descr to ensure that it does.
Bugfix candidate.
|
|
|
|
|
|
| |
SF patch 514641 (Naofumi Honda) - Negative ob_size of LongObjects
that Tim didn't later back out.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
revision 2.164 of object.c
Whether platform malloc(0) returns NULL has nothing to do with whether
platform realloc(p, 0) returns NULL, so MALLOC_ZERO_RETURNS_NULL can
be correctly undefined yet realloc(p, 0) can return NULL anyway.
Prevent realloc(p, 0) doing free(p) and returning NULL via a different
hack. Would probably be better to get rid of MALLOC_ZERO_RETURNS_NULL
entirely.
Bugfix candidate.
|
|
|
|
|
|
|
|
|
|
|
|
| |
revision 1.4 of structseq.c
A fix & test for
[ 496873 ] structseqs unpicklable
by adding a __reduce__ method to structseqs.
Will also commit this to the 2.2.1 branch momentarily.
|
| |
|
| |
|
|
|
|
|
|
| |
[ #495401 ] Build troubles: --with-pymalloc
in a slightly different manner to the trunk, as discussed on python-dev.
|
|
|
|
|
|
|
| |
revision 2.127 of typeobject.c
Allow __doc__ to be of arbitrary type. Patch by James Henstridge,
fixes #504343. 2.2.1 candidate.
|
|
|
|
|
|
|
|
|
|
|
| |
revision 2.54 of complexobject.c
Declare real and imag as read-only attributes.
This fixes SF bug #514858 (Gregory Smith): complex not entirely
immutable
2.2.1 Bugfix candidate!
|
|
|
|
|
|
|
|
| |
Bugfix candidate.
Fix SF bug #511603: Error calling str on subclass of int
Explicitly fill in tp_str with the same pointer as tp_repr.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
both are proxy objects.
|
|
|
|
|
|
|
|
| |
NULL, so that you can call PyType_Ready() to initialize a type that
is to be separately compiled with C on Windows.
inherit_special(): Add a long comment explaining that you have to set
tp_new if your base class is PyBaseObject_Type.
|
|
|
|
| |
unescaped newlines in strings.
|
|
|
|
|
|
| |
Montanaro)
(With minor adjustments.)
|
|
|
|
| |
%300s should be %.300s, twice.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fix for SF bug #492345. (I could've sworn I checked this in, but
apparently I didn't!)
This code:
class Classic:
pass
class New(Classic):
__metaclass__ = type
attempts to create a new-style class with only classic bases -- but it
doesn't work right. Attempts to fix it so it works caused problems
elsewhere, so I'm now raising a TypeError in this case.
|
|
|
|
|
| |
and only if there is no second arg.
This closes SF patch #479551.
|
|
|
|
|
|
|
| |
delivered bizarre results. Check float_divmod for a Py_NotImplemented
return and pass it along (instead of treating Py_NotImplemented as a
2-tuple).
CONVERT_TO_DOUBLE: Added comments; this macro is obscure.
|
|
|
|
| |
division functions, and rename to float_floor_div.
|
|
|
|
|
|
|
| |
PyDict_UpdateFromSeq2(): removed it.
PyDict_MergeFromSeq2(): made it public and documented it.
PyDict_Merge() docs: updated to reveal <wink> that the second
argument can be any mapping object.
|
|
|
|
|
|
| |
references, we do not allow any outstanding exceptions "leak" into the
callback's execution state.
This closes SF bug #478534.
|
|
|
|
| |
bug as the C code. :-(
|
| |
|
|
|
|
|
|
|
|
|
|
| |
no get function was defined, the property's doc string was
inaccessible. This was because the test for prop_get was made
*before* the test for a NULL/None object argument.
Also changed the property class defined in Python in a comment to test
for NULL to decide between get and delete; this makes it less Python
but then, assigning None to a property doesn't delete it!
|
|
|
|
|
|
| |
PyString_FromString():
Since the length of the string is already being stored in size,
changed the strcpy() to a memcpy() for a small speed improvement.
|
|
|
|
|
|
|
|
|
|
|
| |
out the for loop at the end intended to zero out new items wasn't
doing anything, because sv->ob_size was already equal to newsize. The
fix slightly refactors the function, introducing a variable oldsize
and doing away with sizediff (which was used only once), and using
oldsize and newsize consistently. I also added comments explaining
what the two for loops do. (Looking at the CVS annotation of this
function, it's no miracle a bug crept in -- this has been patched by
many different folks! :-)
|
|
|
|
| |
check it. Added an assert() to that effect.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is best reproduced by
while 1:
class U(unicode):
pass
U(u"xxxxxx")
The unicode_dealloc() code wasn't properly freeing the str and defenc
fields of the Unicode object when freeing a subtype instance. Fixed
this by a subtle refactoring that actually reduces the amount of code
slightly.
|
|
|
|
|
|
|
|
|
|
|
|
| |
PyCell_Set() incremenets the reference count, so the earlier XINCREF
causes a leak.
Also make a number of small performance improvements to the code on
the assumption that most of the time variables are not rebound across
a FastToLocals() / LocalsToFast() pair.
Replace uses of PyCell_Set() and PyCell_Get() with PyCell_SET() and
PyCell_GET(), since the frame is guaranteed to contain cells.
|
|
|
|
|
|
|
|
|
|
|
| |
Add a missing DECREF in an obscure corner. If the str() or repr() of
an object passed to a string interpolation -- e.g. "%s" % obj --
returns a non-string, the returned object was leaked.
Repair an indentation glitch.
Replace a bunch of PyString_AsString() calls (and their ilk) with
macros.
|
|
|
|
|
| |
the work each time it found another base class. All the work is
contiguous, so we might as well do it all at once at the end.
|