summaryrefslogtreecommitdiffstats
path: root/Modules
Commit message (Collapse)AuthorAgeFilesLines
* 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.
* Comment repair; no semantic changes.Tim Peters2003-04-071-4/+5
|
* Reworked has_finalizer() to use the new _PyObject_Lookup() insteadTim Peters2003-04-071-73/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | of PyObject_HasAttr(); the former promises never to execute arbitrary Python code. Undid many of the changes recently made to worm around the worst consequences of that PyObject_HasAttr() could execute arbitrary Python code. Compatibility is hard to discuss, because the dangerous cases are so perverse, and much of this appears to rely on implementation accidents. To start with, using hasattr() to check for __del__ wasn't only dangerous, in some cases it was wrong: if an instance of an old- style class didn't have "__del__" in its instance dict or in any base class dict, but a getattr hook said __del__ existed, then hasattr() said "yes, this object has a __del__". But instance_dealloc() ignores the possibility of getattr hooks when looking for a __del__, so while object.__del__ succeeds, no __del__ method is called when the object is deleted. gc was therefore incorrect in believing that the object had a finalizer. The new method doesn't suffer that problem (like instance_dealloc(), _PyObject_Lookup() doesn't believe __del__ exists in that case), but does suffer a somewhat opposite-- and even more obscure --oddity: if an instance of an old-style class doesn't have "__del__" in its instance dict, and a base class does have "__del__" in its dict, and the first base class with a "__del__" associates it with a descriptor (an object with a __get__ method), *and* if that descriptor raises an exception when __get__ is called, then (a) the current method believes the instance does have a __del__, but (b) hasattr() does not believe the instance has a __del__. While these disagree, I believe the new method is "more correct": because the descriptor *will* be called when the object is destructed, it can execute arbitrary Python code at the time the object is destructed, and that's really what gc means by "has a finalizer": not specifically a __del__ method, but more generally the possibility of executing arbitrary Python code at object destruction time. Code in a descriptor's __get__() executed at destruction time can be just as problematic as code in a __del__() executed then. So I believe the new method is better on all counts. Bugfix candidate, but it's unclear to me how all this differs in the 2.2 branch (e.g., new-style and old-style classes already took different gc paths in 2.3 before this last round of patches, but don't in the 2.2 branch).
* initgc(): Rewrote to use the PyModule_AddXYZ API; cuts code size.Tim Peters2003-04-061-17/+14
|
* handle_finalizers(): Rewrote to call append_objects() and gc_list_merge()Tim Peters2003-04-061-36/+31
| | | | | | | | | instead of looping. Smaller and clearer. Faster, too, when we're not appending to gc.garbage: gc_list_merge() takes constant time, regardless of the lists' sizes. append_objects(): Moved up to live with the other list manipulation utilities.
* Switched from METH_VARARGS to METH_NOARGS for the 7 module functions thatTim Peters2003-04-061-44/+17
| | | | take no arguments; cuts generated code size.
* Reworked move_finalizer_reachable() to create two distinct lists:Tim Peters2003-04-061-31/+57
| | | | | | | | | externally unreachable objects with finalizers, and externally unreachable objects without finalizers reachable from such objects. This allows us to call has_finalizer() at most once per object, and so limit the pain of nasty getattr hooks. This fixes the failing "boom 2" example Jeremy posted (a non-printing variant of which is now part of test_gc), via never triggering the nasty part of its __getattr__ method.
* move_finalizers(): Rewrote. It's not necessary for this routineTim Peters2003-04-051-29/+20
| | | | | | | | | | | | | | to special-case classic classes, or to worry about refcounts; has_finalizer() deleted the current object iff the first entry in the unreachable list has changed. I don't believe it was correct to check for ob_refcnt == 1, either: the dealloc routine would get called by Py_DECREF then, but there's nothing to stop the dealloc routine from ressurecting the object, and then gc would remain at the head of the unreachable list despite that its refcount temporarily fell to 0 (and that would lead to an infinite loop in move_finalizers()). I'm still worried about has_finalizer() resurrecting other objects in the unreachable list: what's to stop them from getting collected?
* New comments. Rewrote has_finalizer() as a sequence of ifs instead ofTim Peters2003-04-051-6/+21
| | | | | | squashed-together conditional operators; makes it much easier to step thru in the debugger, and to set a breakpoint on the only dangerous path.
* Fixed new seemingly random segfaults, by moving the initialization ofTim Peters2003-04-051-8/+11
| | | | | | | | | | delstr from initgc() into collect(). initgc() isn't called unless the user explicitly imports gc, so can be used only for initialization of user-visible module features; delstr needs to be initialized for proper internal operation, whether or not gc is explicitly imported. Bugfix candidate? I don't know whether the new bug was backported to 2.2 already.
* Fix Tim's boom example.Jeremy Hylton2003-04-041-20/+54
| | | | | move_finalizers() moves every object from unreachable to collectable or finalizers, unless the object is deallocated first.
* Use fcntl() to put the audio device *back* into blocking mode afterGreg Ward2003-04-041-0/+9
| | | | | opening it in non-blocking mode. Both Guido and David Hammerton have reported that this fixes their problems with ossaudiodev -- hooray!
* Add get_referrents() helper function.Jeremy Hylton2003-04-031-1/+1
|
* Add get_referrents() helper function.Jeremy Hylton2003-04-031-1/+32
|
* Revert Patch #670715: iconv support.Martin v. Löwis2003-04-032-727/+0
|
* init_bsddb(): Added a few symbols that Greg forgot.Barry Warsaw2003-03-311-1/+4
|
* SF patch #667548, Add some audio constants by Michael PruettNeal Norwitz2003-03-301-3/+25
| | | | Also remove a few unused variables. Built on IRIX 6.5.
* Get build working with pre-C99 compilersNeal Norwitz2003-03-301-1/+1
|
* Patch #650412: Check whether the address of flock and getpagesizeMartin v. Löwis2003-03-301-1/+13
| | | | can be taken, and use _SC_PAGE_SIZE if getpagesize is not available.
* Patch #672053: Return a result from Py_Main, instead of exiting.Martin v. Löwis2003-03-301-9/+9
|