summaryrefslogtreecommitdiffstats
path: root/Modules
Commit message (Collapse)AuthorAgeFilesLines
* Fix array.array.insert(), so that it treats negative indices asWalter Dörwald2003-05-181-2/+5
| | | | | being relative to the end of the array, just like list.insert() does. This closes SF bug #739313.
* Added more words about the abuse of the tp_alloc nitems argumentTim Peters2003-05-181-1/+12
| | | | perpetrated by the time and datetime classes.
* datetime.timedelta is now subclassable in Python. The new test showsTim Peters2003-05-171-165/+170
| | | | | | | | one good use: a subclass adding a method to express the duration as a number of hours (or minutes, or whatever else you want to add). The native breakdown into days+seconds+us is often clumsy. Incidentally moved a large chunk of object-initialization code closer to the top of the file, to avoid worse forward-reference trickery.
* datetime.datetime and datetime.time can now be subclassed in Python. Brr.Tim Peters2003-05-171-30/+46
|
* Turns out there wasn't a need to define tp_free for any of the types here.Tim Peters2003-05-161-4/+4
|
* Stopped using the old macro form of _PyObject_Del.Tim Peters2003-05-161-4/+4
|
* DB.remove() needs to set the internal DB handle to NULL after being called.Gregory P. Smith2003-05-151-4/+1
| | | | | | | (sourceforge pybsddb bug #737970). Also: don't allow other threads to run during calls that invalidate the DB handle.
* Patch #734231: Update RiscOS support. In particular, correctMartin v. Löwis2003-05-103-9/+51
| | | | riscospath.extsep, and use os.extsep throughout.
* Simple fix forMichael W. Hudson2003-05-091-0/+5
| | | | [ 733781 ] fcntl fails to build on old RH Linux
* Patch #734118: Add {get|set}busywaitinterval.Martin v. Löwis2003-05-091-2/+44
|
* Yet another addition to [731644]: only use the lock if thread-supportJust van Rossum2003-05-091-2/+2
| | | | is enabled.
* Addition to [731644]: also use the lock when using the getaddrinfoJust van Rossum2003-05-091-2/+2
| | | | emulation (ie. when HAVE_GETADDRINFO isn't defined).
* [ 731644] & [ 604210 ] Release the GIL around getaddrinfo(), yet protectJust van Rossum2003-05-091-10/+45
| | | | | access with lock on those platforms that getaddrinfo() isn't (known to be) thread-safe. Thanks to MvL for mentoring this patch.
* add open function to bsddb185 module so the file format sniffing can beSkip Montanaro2003-05-061-0/+2
| | | | restricted to the whichdb module
* Patch #724588: Check whether the address of hstrerror and inet_pton canMartin v. Löwis2003-05-031-0/+10
| | | | be taken, and define NI_MAX{HOST|SERV} if necessary.
* Implement tcl object __cmp__.Martin v. Löwis2003-05-031-1/+12
|
* Patch #708495: Port more stuff to OpenVMS.Martin v. Löwis2003-05-038-84/+35
|
* * Added a substantial number of edge case and argument tests forRaymond Hettinger2003-05-031-0/+3
| | | | | | | the itertoolsmodule. * Taught itertools.repeat(obj, n) to treat negative repeat counts as zero. This behavior matches that for sequences and prevents infinite loops.
* The previous made the stop argument optional.Raymond Hettinger2003-05-021-2/+2
| | | | It is better to be explicit and just allow stop to be None.
* SF bug #730685: itertools.islice stop argument is not optionalRaymond Hettinger2003-05-021-13/+33
| | | | | * itertools.islice() stop argument did not perform as documented. * beefed-up test suite
* SF patch 731504: Typo in datetimemodule.c comment.Tim Peters2003-05-021-1/+1
| | | | s/isofomat/isoformat/, by Steven Taschuk.
* Patch 731209: Restore socketmodule's behaviour with dotted quad addressesAnthony Baxter2003-05-021-0/+16
| | | | | to that of Python2.1. Such nnn.nnn.nnn.nnn addresses are just used directly, not passed to the resolver for a pointless lookup.
* Convert tcl objects to strings in getvar/setvar. Fixes #730506.Martin v. Löwis2003-05-011-2/+26
|
* Patch #725942: Always rename emulation functions.Martin v. Löwis2003-05-011-2/+5
|
* Allow _sre.c to compile with Python 2.2Andrew M. Kuchling2003-04-301-0/+4
|
* When an unhandled exception happens, report the repr() of the functionGuido van Rossum2003-04-291-5/+13
| | | | | | | that was used to start the thread. This is useful to track down the source of the problem when there is no traceback, as can happen when a daemon thread gets to run after Python is finialized (a new kind of event, somehow this is now possible due to changes in Py_Finalize()).
* Applying patch #728656, by logistix, fixing opening of nonexistentGustavo Niemeyer2003-04-291-1/+1
| | | | bz2 files. Also, included a testcase for this problem.
* - Included detailed documentation in _sre.c explaining how, when, and whyGustavo Niemeyer2003-04-271-17/+41
| | | | | | | | | | | | to use LASTMARK_SAVE()/LASTMARK_RESTORE(), based on the discussion in patch #712900. - Cleaned up LASTMARK_SAVE()/LASTMARK_RESTORE() usage, based on the established rules. - Moved the upper part of the just commited patch (relative to bug #725106) to outside the for() loop of BRANCH OP. There's no need to mark_save() in every loop iteration.
* Fix for part of the problem mentioned in #725149 by Greg Chapman.Gustavo Niemeyer2003-04-271-8/+10
| | | | | | | | | | | | | | | | | | | This problem is related to a wrong behavior from mark_save/restore(), which don't restore the mark_stack_base before restoring the marks. Greg's suggestion was to change the asserts, which happen to be the only recursive ops that can continue the loop, but the problem would happen to any operation with the same behavior. So, rather than hardcoding this into asserts, I have changed mark_save/restore() to always restore the stackbase before restoring the marks. Both solutions should fix these two cases, presented by Greg: >>> re.match('(a)(?:(?=(b)*)c)*', 'abb').groups() ('b', None) >>> re.match('(a)((?!(b)*))*', 'abb').groups() ('b', None, None) The rest of the bug and patch in #725149 must be discussed further.
* Applied patch #725106, by Greg Chapman, fixing capturing groupsGustavo Niemeyer2003-04-271-0/+10
| | | | | | | | | | | | | | | | | | | | within repeats of alternatives. The only change to the original patch was to convert the tests to the new test_re.py file. This patch fixes cases like: >>> re.match('((a)|b)*', 'abc').groups() ('b', '') Which is wrong (it's impossible to match the empty string), and incompatible with other regex systems, like the following examples show: % perl -e '"abc" =~ /^((a)|b)*/; print "$1 $2\n";' b a % echo "abc" | sed -r -e "s/^((a)|b)*/\1 \2|/" b a|c
* Applying patch #726869 by Andrew I MacIntyre, reducing in _sre.c theGustavo Niemeyer2003-04-271-0/+9
| | | | recursion limit for certain setups of FreeBSD and OS/2.
* Applying patch by Neal Norwitz:Gustavo Niemeyer2003-04-271-0/+25
| | | | [#727759] get bzip2 to build on Solaris 8 (old bzip library)
* Patch by Jp Calderone:Guido van Rossum2003-04-251-1/+114
| | | | | | | | | - The socket module now provides the functions inet_pton and inet_ntop for converting between string and packed representation of IP addresses. See SF patch #658327. This still needs a bit of work in the doc area, because it is not available on all platforms (especially not on Windows).
* New support functions for test_getargs2.Thomas Heller2003-04-241-69/+70
| | | | | Theres now a separate function for each of the format codes b, B, H, I, k, i, l, L, K.
* SF patch 695710: fix bug 678519: cStringIO self iteratorRaymond Hettinger2003-04-241-65/+56
| | | | (requested by GvR. patch contributed by Michael Stone)
* Added a comment about backward compatibility requirements and a linkBarry Warsaw2003-04-241-1/+9
| | | | to the PyBSDDB project at SourceForge.
* [Patch #679505] Trigger DeprecationWarning on importing the rotor moduleAndrew M. Kuchling2003-04-241-0/+4
|
* SF 686323: Minor array module enhancementsRaymond Hettinger2003-04-241-4/+6
| | | | Allows use of tuples for the initializer.
* SF Patch 685051: fix for 680789: reprs in arraymoduleRaymond Hettinger2003-04-231-30/+15
| | | | | | | | | | | | | (contributed by logistix; substantially reworked by rhettinger). To create a representation of non-string arrays, array_repr() was starting with a base Python string object and repeatedly using += to concatenate the representation of individual objects. Logistix had the idea to convert to an intermediate tuple form and then join it all at once. I took advantage of existing tools and formed a list with array_tolist() and got its representation through PyObject_Repr(v) which already has a fast implementation for lists.
* Enable os.fsync() for Windows, mapping it to MS's _commit() there. TheTim Peters2003-04-231-16/+18
| | | | | | docs here are best-guess: the MS docs I could find weren't clear, and some even claimed _commit() has no effect on Win32 systems (which is easily shown to be false just by trying it).
* PyObject_IsTrue() can return an error condition.Raymond Hettinger2003-04-231-1/+4
| | | | Adding code to handle it properly.
* Update to the new PyGILState APIs to simplify and correct thread-stateMark Hammond2003-04-221-2/+15
| | | | | management. Old code still #ifdef'd out - I may remove this in a sec, but for now, let's get it in and things passing the tests again!
* Made MAX_UNTIL/MIN_UNTIL code more coherent about mark protection,Gustavo Niemeyer2003-04-221-4/+6
| | | | accordingly to further discussions with Greg Chapman in patch #712900.
* Get test_capi & test_getargs2 to pass on alphasNeal Norwitz2003-04-221-6/+19
| | | | | | * UINT_MAX -> ULONG_MAX since we are dealing with longs * ParseTuple needs &int for 'i' and &long for 'l' There may be a better way to do this, but this works.
* apply Mark Hammond's PEP 311 changes to the EMX ripoff of the WindowsAndrew MacIntyre2003-04-211-51/+6
| | | | popen[234]() code
* - DosSetExtLIBPATH objects to a NULL pointer, but a pointer to a NULLAndrew MacIntyre2003-04-211-7/+1
| | | | | | | string does what is expected (ie unset [BEGIN|END]LIBPATH) - set the size of the DosQuerySysInfo buffer correctly; it was safe, but incorrect (allowing a 1 element overrun)
* More work on bug #672491 and patch #712900.Gustavo Niemeyer2003-04-201-23/+38
| | | | | | | | | | | | | | | | I've applied a modified version of Greg Chapman's patch. I've included the fixes without introducing the reorganization mentioned, for the sake of stability. Also, the second fix mentioned in the patch don't fix the mentioned problem anymore, because of the change introduced by patch #720991 (by Greg as well). The new fix wasn't complicated though, and is included as well. As a note. It seems that there are other places that require the "protection" of LASTMARK_SAVE()/LASTMARK_RESTORE(), and are just waiting for someone to find how to break them. Particularly, I belive that every recursion of SRE_MATCH() should be protected by these macros. I won't do that right now since I'm not completely sure about this, and we don't have much time for testing until the next release.
* - Fixed bug #672491. This change restores the behavior of lastindex/lastgroupGustavo Niemeyer2003-04-201-5/+4
| | | | | | to be compliant with previous python versions, by backing out the changes made in revision 2.84 which affected this. The bugfix for backtracking is still maintained.
* New PyGILState_ API - implements pep 311, from patch 684256.Mark Hammond2003-04-192-50/+53
|
* Fully support 32-bit codes. Enable BIGCHARSET in UCS-4 builds.Martin v. Löwis2003-04-192-11/+43
|