summaryrefslogtreecommitdiffstats
path: root/Modules
Commit message (Collapse)AuthorAgeFilesLines
* 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
|
* Implement IDNA (Internationalized Domain Names in Applications).Martin v. Löwis2003-04-181-5/+25
|
* SF # 595026: support for masks in getargs.c.Thomas Heller2003-04-171-0/+149
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | New functions: unsigned long PyInt_AsUnsignedLongMask(PyObject *); unsigned PY_LONG_LONG) PyInt_AsUnsignedLongLongMask(PyObject *); unsigned long PyLong_AsUnsignedLongMask(PyObject *); unsigned PY_LONG_LONG) PyLong_AsUnsignedLongLongMask(PyObject *); New and changed format codes: b unsigned char 0..UCHAR_MAX B unsigned char none ** h unsigned short 0..USHRT_MAX H unsigned short none ** i int INT_MIN..INT_MAX I * unsigned int 0..UINT_MAX l long LONG_MIN..LONG_MAX k * unsigned long none L long long LLONG_MIN..LLONG_MAX K * unsigned long long none Notes: * New format codes. ** Changed from previous "range-and-a-half" to "none"; the range-and-a-half checking wasn't particularly useful. New test test_getargs2.py, to verify all this.
* - New C API PyGC_Collect(), same as calling gc.collect().Guido van Rossum2003-04-171-1/+19
| | | | | - Call this in Py_Finalize(). - Expand the Misc/NEWS text on PY_LONG_LONG.
* Support UCS-4 Tcl for UCS-4 Python builds. Fixes #719880.Martin v. Löwis2003-04-161-4/+8
|
* Minor source formatting fixes.Raymond Hettinger2003-04-161-2/+2
|
* Use object interface for global vars. Fixes #721171.Martin v. Löwis2003-04-151-127/+94
| | | | Also move complete processing of get/set/delvar calls to target thread.
* The date class is now properly subclassable. (SF bug #720908)Guido van Rossum2003-04-141-5/+8
| | | | | (This is only the tip of the iceberg; the time and datetime classes need the same treatment.)
* SF patch #720991 by Gary Herron:Guido van Rossum2003-04-142-0/+61
| | | | | | | A small fix for bug #545855 and Greg Chapman's addition of op code SRE_OP_MIN_REPEAT_ONE for eliminating recursion on simple uses of pattern '*?' on a long string.
* Fix docstring typoAndrew M. Kuchling2003-04-141-1/+1
|
* Make readers and writers participate in garbage collection.Jeremy Hylton2003-04-141-14/+71
| | | | Fix memory leak in dialect_init().
* Must declare vrbls at the tops of blocks in C89 (wouldn't compile).Tim Peters2003-04-131-1/+2
|
* use PyModule_Add{Int,String}Constant() where appropriateSkip Montanaro2003-04-121-12/+6
| | | | (thanks to Neal Norwitz for the code review, BTW)
* tighten up string checksSkip Montanaro2003-04-121-17/+18
| | | | make csv_{get,unregister}_dialect METH_O functions to avoid PyArg_ParseTuple
* add writerows docstringSkip Montanaro2003-04-121-6/+24
| | | | conditionally exclude Unicode functions
* typoSkip Montanaro2003-04-111-1/+1
|
* typoSkip Montanaro2003-04-111-1/+1
|
* zap commented out bit of codeSkip Montanaro2003-04-111-2/+1
|
* SF patch #718867: Fix reference leak for time.strptimeRaymond Hettinger2003-04-101-1/+4
| | | | (contributed by Brett Cannon)
* Make Unpickler objects colletable.Jeremy Hylton2003-04-091-23/+65
| | | | Bugfix candidate.
* Make Picklers collectable.Jeremy Hylton2003-04-091-5/+45
| | | | Bug fix candidate.
* Fix two crashes on Windows:Guido van Rossum2003-04-091-2/+2
| | | | | - CHECK_VALID() was checking the wrong value for a closed fd - fseek(&_iob[fileno], ...) doesn't work for fileno >= 20
* Don't use (PyObject *)PyObject_Type(x). It is a leaky and verbose wayGuido van Rossum2003-04-091-2/+2
| | | | of saying x->ob_type.
* tentative fix for #712322: modification time stamp checking failedJust van Rossum2003-04-081-1/+1
| | | | when DST began.
* s/referrents/referents/g. Gotta love that referrers remains rife with rs.Tim Peters2003-04-081-8/+8
|
* Finished implementing gc.get_referrents(): dealt with error and endTim Peters2003-04-081-6/+15
| | | | cases, wrote docs, added a test.