| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
| |
Fix SF #745055, Memory leak in _tkinter.c/Tkapp_SplitList()
Also fix a memory leak in Tkapp_Split.
|
| | |
|
| |
|
|
|
|
| |
Add a tp_new slot to function objects that handles the case of a
function requiring a closure. Put the function type in the new
module, rather than having a function new.function(). Add tests.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
tp_free is NULL or PyObject_Del at the end. Because it's a base type
it must call tp_free in its dealloc function, and because it's gc'able
it must not call PyObject_Del.
inherit_slots(): Don't inherit tp_free unless the type and its base
agree about whether they're gc'able. If the type is gc'able and the
base is not, and the base uses the default PyObject_Del for its
tp_free, give the type PyObject_GC_Del for its tp_free (the appropriate
default for a gc'able type).
cPickle.c: The Pickler and Unpickler types claim to be base classes
and gc'able, but their dealloc functions didn't call tp_free.
Repaired that. Also call PyType_Ready() on these typeobjects, so
that the correct (PyObject_GC_Del) default memory-freeing function
gets plugged into these types' tp_free slots.
|
| |
|
|
| |
classmethod, staticmethod, cPickle.Pickler, cPickle.UNpickler
|
| |
|
|
|
|
| |
as "a bug" because there's no other way in core Python to ensure that
bytes written are actually on disk. At least ZODB wants this guarantee,
for robustness against crashes.
|
| | |
|
| | |
|
| |
|
|
|
|
| |
of classic classes now. Alas, new-style classes are still a problem, and
didn't need to be fixed in 2.3 (they were already immune in 2.3 due to the
new-in-2.3 tp_del slot).
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The move_finalizers() routine checks each object in the unreachable
list to see if it has a finalizer. If it does, it is moved to the
finalizers list. The collector checks by calling, effectively,
hasattr(obj, "__del__"). The hasattr() call can result in an
arbitrary amount of Python code being run, because it will invoke
getattr hooks on obj.
If a getattr() hook is run from move_finalizers(), it may end up
resurrecting or deallocating objects in the unreachable list. In
fact, it's possible that the hook causes the next object in the list
to be deallocated. That is, the object pointed to by gc->gc.gc_next
may be freed before has_finalizer() returns.
The problem with the previous revision is that it followed
gc->gc.gc_next before calling has_finalizer(). If has_finalizer()
gc->happened to deallocate the object FROM_GC(gc->gc.gc_next), then
the next time through the loop gc would point to freed memory. The
fix is to always follow the next pointer after calling
has_finalizer().
Note that Python 2.3 does not have this problem, because
has_finalizer() checks the tp_del slot and never runs Python code.
Tim, Barry, and I peed away the better part of two days tracking this
down.
|
| | |
|
| |
|
|
|
|
|
|
|
| |
Check for readline 2.2 features. This should make it possible to
compile readline.c again with GNU readline versions 2.0 or 2.1; this
ability was removed in readline.c rev. 2.49. Apparently the older
versions are still in widespread deployment on older Solaris
installations. With an older readline, completion behavior is subtly
different (a space is always added).
|
| |
|
|
|
|
|
|
|
|
| |
pack_float, pack_double, save_float: All the routines for creating
IEEE-format packed representations of floats and doubles simply ignored
that rounding can (in rare cases) propagate out of a long string of
1 bits. At worst, the end-off carry can (by mistake) interfere with
the exponent value, and then unpacking yields a result wrong by a factor
of 2. In less severe cases, it can end up losing more low-order bits
than intended, or fail to catch overflow *caused* by rounding.
|
| |
|
|
|
|
|
| |
invalid, rather than returning a string of random garbage of the
estimated result length. Closes SF patch #703471 by Hye-Shik Chang.
Backport from 2.3.
|
| |
|
|
|
|
| |
Fix memory leak: free memory storing the content model passed to the
ElementDeclHandler by Expat.
Fixes SF bug #676990.
|
| | |
|
| |
|
|
| |
completion was botched.
|
| | |
|
| |
|
|
| |
Backport of fix from head.
|
| | |
|
| |
|
|
|
| |
Make length an int so we get the right value from
PyArg_ParseTuple(args, "s#", &str, &length)
|
| |
|
|
|
|
|
|
| |
revision 2.75
date: 2003/01/29 14:20:22; author: mwh; state: Exp; lines: +2 -0
Teach the parsermodule about floor division. Fixes
[ 676521 ] parser module validation failure
|
| | |
|
| |
|
|
|
|
| |
SF #665913, Fix mmap module core dump with unix
Closing an mmap'ed file (calling munmap) twice on Solaris caused a core dump.
|
| |
|
|
|
| |
Fix from Michael Stone for SF bug #660476 and #513033 (bogus thread
state swaps in readline).
|
| |
|
|
|
| |
datum.dsize can apparently be long on some systems.
Ensure we pass an int* to PyArg_Parse("s#"), not &datum.dsize
|
| |
|
|
|
| |
h_errno is not defined on HPUX with the 2.2 build env't
(ie, _XOPEN_SOURCE_EXTENDED is not defined)
|
| |
|
|
|
|
|
| |
SF #633013, Fix NIS causing interpreter core dump
Prevent the lengths passed to PyString_FromStringAndSize()
from being negative in some cases.
|
| | |
|
| |
|
|
|
|
| |
[ 617309 ] getframe hook (Psyco #1)
Forward port candidate.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
SF #558432: Prevent Annoying ' ' from readline (Holker Krekel).
readline in all python versions is configured
to append a 'space' character for a successful
completion. But for almost all python expressions
'space' is not wanted (see coding conventions PEP 8).
For example if you have a function 'longfunction'
and you type 'longf<TAB>' you get 'longfunction '
as a completion. note the unwanted space at the
end.
The patch fixes this behaviour by setting readline's
append_character to '\0' which means don't append
anything. This doesn't work with readline < 2.1
(AFAIK nowadays readline2.2 is in good use).
An alternative approach would be to make the
append_character
accessable from python so that modules like
the rlcompleter.py can set it to '\0'.
[Ed.: I think expecting readline >= 2.2 is fine. If a completer wants
another character they can append that to the keyword in the list.]
|
| | |
|
| | |
|
| | |
|
| |
|
|
| |
Patch for the DEC Alpha under Linux, by Lee Busby.
|
| |
|
|
|
| |
issues with varying versions of Expat; this completes the previous fix
for this version. (Not relevant for the trunk.)
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
revision 2.36 of binascii.c
Another stab at SF 576327: zipfile when sizeof(long) == 8
binascii_crc32(): The previous patch forced this to return the same
result across platforms. This patch deals with that, on a 64-bit box,
the *entry* value may have "unexpected" bits in the high four bytes.
Bugfix candidate.
--------
More whitespace cleanup related conflict removal... sigh.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
revision 2.35 of binascii.c
Fix for SF bug #576327: zipfile when sizeof(long) == 8
binascii_crc32(): Make this return a signed 4-byte result across
platforms. The other way to make this platform-independent would be to
make it return an unsigned unbounded int, but the evidence suggests
other code out there treats it like a signed 4-byte int (e.g., existing
code writing the result with struct.pack "l" format).
Bugfix candidate.
|
| |
|
|
|
|
| |
On Windows, call WSAGetLastError() to retrieve the error number.
Bugfix candidate, will backport to release22-maint myself.
|
| |
|
|
|
|
| |
XML_Parser, which happens to be a pointer type, not an XML_Parser*.
This generated warnings when compiled with Expat 1.95.5, which no
longer defines XML_Parser to be void*.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
revision 2.87 of cPickle.c
Do more robust test of whether global objects are accessible.
PyImport_ImportModule() is not guaranteed to return a module object.
When another type of object was returned, the PyModule_GetDict() call
return NULL and the subsequent GetItem() seg faulted.
Bug fix candidate.
----------
Once again, whitespace chances scuppered automatic backporting, so
I did this by hand. Review probably wise -- but I have run make test!
Also incorporates revision 2.88 which was just removing a now unused
declaration.
|
| |
|
|
| |
#544265, Remove warnings for passing const to free()
|
| |
|
|
|
|
|
|
| |
(Most of) SF patch 601369 (Christos Georgiou): obmalloc,structmodule:
64bit, big endian (issue 2 only).
This adds a bunch of memcpy calls via a temporary variable to avoid
alignment errors. That's needed for some platforms.
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
| |
Raise ValueError if user passes a size to mmap which is larger
than the file.
Also need Tim's fix in test_mmap.py, 1.22 which flushes the file
before mmap'ing it.
|
| |
|
|
|
|
|
|
|
|
|
| |
revision 2.234 of posixmodule.c
SF bug 563750 (Alex Martelli): posix_tmpfile():
The file returned by tmpfile() has mode w+b, so use that in the call
to PyFile_FromFile().
Bugfix candidate.
|
| |
|
|
|
| |
popen2() and popen3() created text-mode pipes even when binary mode
was asked for. This was specific to Windows.
|
| |
|
|
|
|
|
|
|
| |
base64.decodestring('') should return '' instead of raising an
exception. The bug fix for SF #430849 wasn't quite right. This
closes SF bug #595671. I'll backport this to Python 2.2.
One addition here is that there was no test of the base64 module in
Python 2.2 cvs yet, so I added that too.
|
| | |
|