summaryrefslogtreecommitdiffstats
path: root/Modules
Commit message (Collapse)AuthorAgeFilesLines
* Backport 1.160:Neal Norwitz2003-05-291-4/+11
| | | | | | Fix SF #745055, Memory leak in _tkinter.c/Tkapp_SplitList() Also fix a memory leak in Tkapp_Split.
* Squash new compiler wng (mistmatching formal/actual pointer types).Tim Peters2003-05-221-1/+1
|
* Backport fix for SF bug 692776.Jeremy Hylton2003-05-221-46/+5
| | | | | | 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.
* PyType_Ready(): Complain if the type is a base type, and gc'able, andTim Peters2003-05-211-2/+7
| | | | | | | | | | | | | | | | | | 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.
* Backport fixes to make more types collectable.Jeremy Hylton2003-05-091-76/+108
| | | | classmethod, staticmethod, cPickle.Pickler, cPickle.UNpickler
* fsync(): Implemented for Windows, via calling MS _commit. This countsTim Peters2003-04-231-0/+2
| | | | | | 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.
* Backport reference leak fix from HEAD revision 1.79.Fred Drake2003-04-091-2/+2
|
* Fixed the gc-vs-__del__ bugs for new-style classes. That's it for this one.Tim Peters2003-04-081-10/+6
|
* More backporting of gc-vs-__del__ fixes. It should be fixed for instancesTim Peters2003-04-081-5/+17
| | | | | | 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).
* Fix memory corruption in garbage collection.Jeremy Hylton2003-04-031-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Patch #695250: Suppress COPYRIGHT if site.py is not read. Fixes #672614.Martin v. Löwis2003-03-301-3/+6
|
* Backport Patch 659834 checked in by GvR on 2002/12/30 16:25:38Neal Norwitz2003-03-291-0/+2
| | | | | | | | | 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).
* SF bug 705836: struct.pack of floats in non-native endian orderTim Peters2003-03-202-24/+67
| | | | | | | | | | 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.
* binascii_a2b_base64: Properly return an empty string if the input was allThomas Wouters2003-03-171-0/+4
| | | | | | | 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.
* Backport patch from revision 2.80:Fred Drake2003-03-061-24/+52
| | | | | | Fix memory leak: free memory storing the content model passed to the ElementDeclHandler by Expat. Fixes SF bug #676990.
* get_completer() takes no argsNeal Norwitz2003-03-011-2/+2
|
* - Backported SF patch #676342: after using pdb, the readline commandGuido van Rossum2003-03-011-0/+18
| | | | completion was botched.
* Backport: Add more missing PyErr_NoMemory() after failled memory allocsNeal Norwitz2003-02-112-3/+3
|
* SF bug 684667: Modules/selectmodule.c returns NULL without exception set.Tim Peters2003-02-111-1/+1
| | | | Backport of fix from head.
* Partial backport for changes to fix SF bug #678518 (assert & global).Neal Norwitz2003-02-101-2/+4
|
* SF patch #682514, mmapmodule.c write fix for LP64 executablesNeal Norwitz2003-02-071-1/+1
| | | | | Make length an int so we get the right value from PyArg_ParseTuple(args, "s#", &str, &length)
* backport:Neal Norwitz2003-02-021-0/+2
| | | | | | | | 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
* Backport SF # 669553, fix memory (ref) leaksNeal Norwitz2003-01-191-10/+20
|
* backport:Neal Norwitz2003-01-101-2/+4
| | | | | | SF #665913, Fix mmap module core dump with unix Closing an mmap'ed file (calling munmap) twice on Solaris caused a core dump.
* Backport 2.58 from trunk (minus the cleanup):Guido van Rossum2003-01-071-12/+6
| | | | | Fix from Michael Stone for SF bug #660476 and #513033 (bogus thread state swaps in readline).
* Fix SF # 640557, '64-bit' systems and the dbm moduleNeal Norwitz2002-11-221-6/+17
| | | | | datum.dsize can apparently be long on some systems. Ensure we pass an int* to PyArg_Parse("s#"), not &datum.dsize
* Fix SF # 505427, socket module fails to build on HPUX10Neal Norwitz2002-11-141-0/+5
| | | | | h_errno is not defined on HPUX with the 2.2 build env't (ie, _XOPEN_SOURCE_EXTENDED is not defined)
* Backport last checkin:Neal Norwitz2002-11-041-2/+4
| | | | | | | SF #633013, Fix NIS causing interpreter core dump Prevent the lengths passed to PyString_FromStringAndSize() from being negative in some cases.
* Backport 2.34. SF #621948, update docstring for md5 by David M. CookeNeal Norwitz2002-10-111-0/+1
|
* This is Armin Rigo's patch:Michael W. Hudson2002-10-071-1/+1
| | | | | | [ 617309 ] getframe hook (Psyco #1) Forward port candidate.
* Backport 2.49:Raymond Hettinger2002-10-061-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | 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 #615069: Fix build problems on SCO Open Server 5.Martin v. Löwis2002-09-302-1/+3
|
* Backport all changes from trunk (all cosmetic).Guido van Rossum2002-09-301-7/+4
|
* Backport Jack's fix for Jaguar.Michael W. Hudson2002-09-271-0/+5
|
* Backport of 2.18:Guido van Rossum2002-09-261-0/+8
| | | | Patch for the DEC Alpha under Linux, by Lee Busby.
* The Python 2.2.x version of pyexpat needs more changes to avoid typeFred Drake2002-09-251-8/+8
| | | | | issues with varying versions of Expat; this completes the previous fix for this version. (Not relevant for the trunk.)
* backport tim_one's checkin ofMichael W. Hudson2002-09-251-100/+106
| | | | | | | | | | | | | | | 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.
* backport tim_one's checkin ofMichael W. Hudson2002-09-251-1/+11
| | | | | | | | | | | | | 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.
* backport of the checkin of revision 2.69 of selectmodule.cThomas Heller2002-09-241-0/+7
| | | | | | On Windows, call WSAGetLastError() to retrieve the error number. Bugfix candidate, will backport to release22-maint myself.
* Be more careful with the type of the xmlhandlersetter; it takes anFred Drake2002-09-241-1/+1
| | | | | | 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*.
* backport jhylton's checkin ofMichael W. Hudson2002-09-241-3/+4
| | | | | | | | | | | | | | | | | | | | 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.
* Backport 2.48 from trunk:Guido van Rossum2002-09-241-1/+1
| | | | #544265, Remove warnings for passing const to free()
* Backport 2.57 from trunk:Guido van Rossum2002-09-231-27/+54
| | | | | | | | (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.
* Add recursion limit to pickling. Fixes #576084.Martin v. Löwis2002-09-221-0/+9
|
* SF # 602108 ensure string is null terminated after strncpyNeal Norwitz2002-09-131-0/+1
|
* Backport of SF bug # 585792, Invalid mmap crashes Python interpreterNeal Norwitz2002-09-051-1/+11
| | | | | | | | 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.
* backport gvanrossum's checkin ofMichael W. Hudson2002-08-231-1/+1
| | | | | | | | | | | 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.
* SF bug 595919: popenN return only text mode pipesTim Peters2002-08-191-2/+2
| | | | | popen2() and popen3() created text-mode pipes even when binary mode was asked for. This was specific to Windows.
* Backport of fix for SF bug #595671 from Python 2.3cvs:Barry Warsaw2002-08-151-5/+2
| | | | | | | | | 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.
* SF bug #592645 fix memory leak in socket.getaddrinfoNeal Norwitz2002-08-091-0/+2
|