summaryrefslogtreecommitdiffstats
path: root/Modules
Commit message (Collapse)AuthorAgeFilesLines
* Make weak references subclassable:Fred Drake2004-07-021-22/+3
| | | | | | | | | | | | | | | | | | | | | | - weakref.ref and weakref.ReferenceType will become aliases for each other - weakref.ref will be a modern, new-style class with proper __new__ and __init__ methods - weakref.WeakValueDictionary will have a lighter memory footprint, using a new weakref.ref subclass to associate the key with the value, allowing us to have only a single object of overhead for each dictionary entry (currently, there are 3 objects of overhead per entry: a weakref to the value, a weakref to the dictionary, and a function object used as a weakref callback; the weakref to the dictionary could be avoided without this change) - a new macro, PyWeakref_CheckRefExact(), will be added - PyWeakref_CheckRef() will check for subclasses of weakref.ref This closes SF patch #983019.
* Adds support for DB.pget and DBCursor.pget methods.Gregory P. Smith2004-06-281-3/+198
| | | | | Based on a patch supplied by Ian Ward <ian@arevco.ca> on the pybsddb mailing list 2004-03-26.
* Add weakref support to all bsddb.db objects.Gregory P. Smith2004-06-281-7/+127
| | | | | Make DBTxn objects automatically call abort() in their destructor if not yet finalized and raise a RuntimeWarning to that effect.
* Added socket.getservbyport(), and make its second argument and that ofBarry Warsaw2004-06-281-5/+39
| | | | getservbyname() optional. Update the tests and the docs.
* raise the module minor version.Gregory P. Smith2004-06-271-1/+1
|
* SF patch / bug #967763Gregory P. Smith2004-06-271-43/+76
| | | | | | | | | | | | Fix memory leaks revealed by valgrind and ensuing code inspection. In the existing test suite valgrind revealed two memory leaks (DB_get and DBC_set_range). Code inspection revealed that there were many other potential similar leaks (many on odd code error paths such as passing something other than a DBTxn object for a txn= parameter or in the face of an out of memory error). The most common case that would cause a leak was when using recno or queue format databases with integer keys, sometimes only with an exception exit.
* sizeof(char) is 1, by definition, so get rid of that expression inTim Peters2004-06-271-5/+4
| | | | places it's just noise.
* Add a comment with implementation notes.Raymond Hettinger2004-06-261-0/+7
|
* Modules/getpath.c now compiles properly under OS X when using theBrett Cannon2004-06-261-1/+1
| | | | | | | --disable-framework build; header file was protected in an #if using the wrong macro to check. Closes bug #978645.
* Change comment from C++ style to C.Brett Cannon2004-06-241-1/+1
|
* SF patch 876130: add C API to datetime module, from Anthony Tuininga.Tim Peters2004-06-201-0/+30
| | | | | | The LaTeX is untested (well, so is the new API, for that matter). Note that I also changed NULL to get spelled consistently in concrete.tex. If that was a wrong thing to do, Fred should yell at me.
* Improve the documented advice on how to best use heapq.heapreplace().Raymond Hettinger2004-06-201-1/+2
|
* Use PyArg_UnpackTuple() where possible.Raymond Hettinger2004-06-201-4/+4
|
* Bug 975996: Add _PyTime_DoubleToTimet to C APITim Peters2004-06-202-12/+20
| | | | | | | | | | | New include file timefuncs.h exports private API function _PyTime_DoubleToTimet() from timemodule.c. timemodule should export some other functions too (look for painful bits in datetimemodule.c). Added insane-argument checking to datetime's assorted fromtimestamp() and utcfromtimestamp() methods. Added insane-argument tests of these to test_datetime, and insane-argument tests for ctime(), localtime() and gmtime() to test_time.
* Raise ValueError when value being stored in a time_t variable will result inBrett Cannon2004-06-191-5/+40
| | | | | | | | | | | more than a second of precision. Primarily affects ctime, localtime, and gmtime. Closes bug #919012 thanks to Tim Peters' code. Tim suggests that the new funciton being introduced, _PyTime_DoubletoTimet(), should be added to the internal C API and then used in datetime where appropriate. Not being done now for lack of time.
* Fixed end-of-loop code not reached warning when using SunPro CNicholas Bastin2004-06-172-0/+8
|
* silly typoMichael W. Hudson2004-06-171-1/+1
|
* Reverse argument order for nsmallest() and nlargest().Raymond Hettinger2004-06-151-2/+2
| | | | Reads better when the iterable is a generator expression.
* Return unicode strings from _getfullpathname even on W9X. Fixes #924703 .Martin v. Löwis2004-06-151-0/+4
|
* Patch #826074: cmath.log optional base argument, fixes #823209Raymond Hettinger2004-06-141-7/+27
| | | | (Contributed by Andrew Gaul.)
* SF patch #969180, hotshot incorrectly computes elapsed time by JasonNeal Norwitz2004-06-131-5/+7
| | | | | | | | | | | | | | | | | Beardsley. If the seconds are different, we still need to calculate the differences between milliseconds. Also, on a Gentoo Linux (2.6.5) dual Athlon MP box with glibc 2.3, time can go backwards. This probably happens when the process switches the CPU it's running on. Time can also go backwards when running NTP. If we detect a negative time delta (ie, time went backwards), return a delta of 0. This prevents an illegal array access elsewhere. I think it's safest to *not* update prev_timeofday in this case, so we return without updating. Backport candidate.
* Remove warning (static not being first) when building with -WNeal Norwitz2004-06-131-2/+2
|
* Remove warning about implicit declaration of strcmp()Neal Norwitz2004-06-131-0/+1
|
* Fixup error exits in nlargest() and nsmallest().Raymond Hettinger2004-06-131-8/+16
|
* Install C version of heapq.nsmallest().Raymond Hettinger2004-06-131-5/+162
|
* Install C version of heapq.nlargest().Raymond Hettinger2004-06-121-0/+76
| | | | Maxheap version of heapq.smallest() is forthcoming.
* Ensure path is initialized to prevent freeing random memoryNeal Norwitz2004-06-091-4/+2
| | | | | (reported by Thomas Heller). If have_unicode_filename is set, path looks like it will not be used, so there's no need to free it.
* Patch #774665: Make Python LC_NUMERIC agnostic.Martin v. Löwis2004-06-083-66/+9
|
* SF 952807: Unpickling pickled instances of subclasses of datetime.date,Tim Peters2004-06-071-6/+3
| | | | | | | datetime.datetime and datetime.time could yield insane objects. Thanks to Jiwon Seo for the fix. Bugfix candidate. I'll backport it to 2.3.
* Plug a few memory leaks in utime(). path is allocated from withinNeal Norwitz2004-06-061-4/+12
| | | | | | | PyArg_ParseTuple() since the format is "et" This change should be reviewed carefully. Bugfix candidate.
* Valgrind was reporting an uninitialized read for bad input.Neal Norwitz2004-06-061-1/+2
| | | | | | | | | This fixes the problem and the test passes. I'm not sure the test is really correct though. It seems like it would be better to raise an exception. I think that wasn't done for backwards compatability. Bugfix candidate.
* Fix for #932977: MacOSX does not pass the whole pathname in argv[0] forJack Jansen2004-06-031-0/+17
| | | | | | | | #!-scripts, only the filename part, and this can lead to incorrect initialization of sys.path and sys.executable if there is another python on $PATH before the one used in #!. The fix was picked up from the darwinports crowd, thanks!
* Warn abou missing mutate flag to ioctl. Fixes #696535.Martin v. Löwis2004-06-031-1/+7
|
* Patch #929192: Improvements to bluetooth support.Martin v. Löwis2004-06-031-78/+169
| | | | | | | | Added setbdaddr and makebdaddr. Extended makesockaddr to understand Bluetooth addresses. Changed getsockaddr to expect the Bluetooth addresses as a string, not a six element tuple. Reformatted some of the Bluetooth code to be more consistent with PEP 7.
* Remove pcre moduleAndrew M. Kuchling2004-06-024-5771/+0
|
* - SF #962502: Add two more methods for unicode type; width() andHye-Shik Chang2004-06-022-2/+2
| | | | | | | iswide() for east asian width manipulation. (Inspired by David Goodger, Reviewed by Martin v. Loewis) - Move _PyUnicode_TypeRecord.flags to the end of the struct so that no padding is added for UCS-4 builds. (Suggested by Martin v. Loewis)
* Patch #924294: Do not check for AF_INET6 if it is not defined.Martin v. Löwis2004-06-021-1/+1
| | | | Will backport to 2.3.
* Patch #954115: Fix os.stat handling of UNC roots.Martin v. Löwis2004-06-021-18/+94
| | | | Will backport to 2.3.
* Add weakref support to sockets and re pattern objects.Raymond Hettinger2004-05-312-1/+25
|
* Add weakref support to array.array and file objects.Raymond Hettinger2004-05-311-2/+7
|
* Make sets and deques weak referencable.Raymond Hettinger2004-05-301-2/+8
|
* Band-aid type fix forMichael W. Hudson2004-05-261-0/+19
| | | | | | | [ 728330 ] Don't define _SGAPI on IRIX The Right Thing would be nice, for now this'll do. At least it isn't going to break anything *other* than IRIX...
* stupid, stupid, stupid... raw_input() already supports readline() if theSkip Montanaro2004-05-241-23/+0
| | | | readline module is loaded.
* Exposed readline() function from the readline module.Skip Montanaro2004-05-231-0/+23
|
* Set data pointer to NULL after an error; this keeps the mmap_dealloc() ↵Andrew M. Kuchling2004-05-191-0/+1
| | | | | | function from trying to do msync(-1);munmap(-1). 2.3 bugfix candidate, but this bug isn't critical enough that the fix has to go into 2.3.4
* SF patch #872326: Generator expression implementationRaymond Hettinger2004-05-191-6/+115
| | | | | | | | | | | | | | (Code contributed by Jiwon Seo.) The documentation portion of the patch is being re-worked and will be checked-in soon. Likewise, PEP 289 will be updated to reflect Guido's rationale for the design decisions on binding behavior (as described in in his patch comments and in discussions on python-dev). The test file, test_genexps.py, is written in doctest format and is meant to exercise all aspects of the the patch. Further additions are welcome from everyone. Please stress test this new feature as much as possible before the alpha release.
* Make type check work with subclassesRaymond Hettinger2004-05-181-1/+2
|
* Make sure "del d[n]" is properly supported. Was necessary because theRaymond Hettinger2004-05-121-0/+41
| | | | | | same method that implements __setitem__ also implements __delitem__. Also, there were several good use cases (removing items from a queue and implementing Forth style stack ops).
* In order to fix SF bug # 824977, we replace calloc()/free() calls inBarry Warsaw2004-05-111-9/+16
| | | | | | | binascii_a2b_qp() and binascii_b2a_qp() with calls to PyMem_Malloc() and PyMem_Free(). These won't return NULL unless the allocations actually fail, so it won't trigger a bogus memory error on some platforms <cough>AIX</cough> when passed a length of zero.
* SF #832236: merge from release23-maint branch: wrap a bunch ofGreg Ward2004-05-111-0/+18
| | | | | _EXPORT_INT calls in #ifdef's, to avoid breaking the build on MkLinux (Linux 2.0).