Tim Peters [Fri, 15 Aug 2003 01:16:37 +0000 (01:16 +0000)]
complex_new(): This could leak when the argument was neither string nor
number. This accounts for the 2 refcount leaks per test_complex run
Michael Hudson discovered (I figured only I would have the stomach to
look for leaks in floating-point code <wink>).
Walter Dörwald [Thu, 14 Aug 2003 20:25:29 +0000 (20:25 +0000)]
Fix refcount leak in PyUnicode_EncodeCharmap(). The bug surfaces
when an encoding error occurs and the callback name is unknown,
i.e. when the callback has to be called. The problem was that
the fact that the callback has already been looked up was only
recorded in a local variable in charmap_encoding_error(), because
charmap_encoding_error() got it's own copy of the errorHandler
pointer instead of a pointer to the pointer in
PyUnicode_EncodeCharmap().
Fix reference leak noted in test_types:
Check for a[:] = a _before_ calling PySequence_Fast on a.
release23-maint candidate
Reference leak doesn't happen with head of release22-maint.
Fred Drake [Thu, 14 Aug 2003 15:52:33 +0000 (15:52 +0000)]
When piping output into a pager like "less", quiting the pager before
the output was consumed would cause and exception to be raise in
logmerge; suppress this specific error, because it's not helpful.
Walter Dörwald [Tue, 12 Aug 2003 17:32:43 +0000 (17:32 +0000)]
Enhance message for UnicodeEncodeError and UnicodeTranslateError.
If there is only one bad character it will now be printed in a
form that is a valid Python string.
Now test_descr only appears to leak two references & I think this
are in fact illusory (it's to do with things getting resurrected in
__del__ methods & it's easy to be believe confusion occurs when that
happens <wink>). Woohoo!
Skip Montanaro [Mon, 11 Aug 2003 13:15:11 +0000 (13:15 +0000)]
shit - just change the visible name, not the comments - strictly speaking,
the tp_name is not correct, but what's exposed to users is known visibly as
"StringIO", not "StringI" or "StringO".
The default seed is time.time().
Multiplied by 256 before truncating so that fractional seconds are used.
This way, two successive calls to random.seed() are much more likely
to produce different sequences.
/* XXX From here until type is allocated, "return NULL" leaks bases! */
Sure looks like it to me! <wink>
When I run the leak2.py script I posted to python-dev, I only see
three reference leaks in all of test_descr. When I run
test_descr.test_main, I still see 46 leaks. This clearly demands
posting a yelp to python-dev :-)
This certainly should be applied to release23-maint, and in all
likelyhood release22-maint as well.
SF bug #782369: Massive memory leak in array module
Fixed leak caused by switching from PyList_GetItem to PySequence_GetItem.
Added missing NULL check.
Clarified code by converting an "if" to an "else if".
Fred Drake [Tue, 5 Aug 2003 05:00:23 +0000 (05:00 +0000)]
init_myformat(): None of the "mark" values can be empty strings, or
LaTeX2HTML feels free to remove a surrounding element that
contains no other content. Since such an element is typically a
named anchor used for hyperlinking, they should not be removed.
Unfortunatley, making sure these marks are non-empty is the most
direct way of avoiding this behavior.
Thanks to Dave Kuhlman for tracking this down; this was some excellent
detective work!
Brett Cannon [Tue, 5 Aug 2003 04:02:49 +0000 (04:02 +0000)]
Re-introduce caching of TimeRE and compiled regexes with added thread-safety.
Also remove now unnecessary property attributes for thread safety
(no longer have lazy attributes) and code simplicity reasons.
Timezone storage has been reworked to be simpler and more flexible. All values
in LocaleTime instances are lower-cased. This is all done to simplify the
module.
The module now assumes nothing beyond the strptime function will be exposed for
general use beyond providing functionality for strptime.
Tim Peters [Tue, 29 Jul 2003 17:22:57 +0000 (17:22 +0000)]
SF bug 778400: IDLE hangs when selecting "Edit with IDLE".
The fix is confined to the Windows installer.
Not a bugfix candidate: the need for the new -n switch added here was
introduced by moving to the idlefork IDLE (so this change isn't needed
or helpful before 2.3).