summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Patch by Russel Owen: if we have command line arguments zap pyc filesJack Jansen2002-08-091-12/+15
| | | | in the directories given.
* Fix to ensure consistent 'repr' and 'str' results between PythonSteve Purcell2002-08-091-7/+10
| | | | | versions, since 'repr(new_style_class) != repr(classic_class)'. Suggested by Jeremy Hylton.
* Depracated some non-carbon modules.Jack Jansen2002-08-093-0/+1013
|
* This file should have gone long ago.Jack Jansen2002-08-091-18/+0
|
* Repaired a braino in the description of bad minrun values.Tim Peters2002-08-091-3/+3
|
* SF bug #592645 fix memory leak in socket.getaddrinfoNeal Norwitz2002-08-091-0/+2
|
* Update the text on the Expat module and library.Fred Drake2002-08-091-17/+9
|
* Major speedup for new-style class creation. Turns out there was someGuido van Rossum2002-08-091-0/+22
| | | | | | | | | | | | trampolining going on with the tp_new descriptor, where the inherited PyType_GenericNew was overwritten with the much slower slot_tp_new which would end up calling tp_new_wrapper which would eventually call PyType_GenericNew. Add a special case for this to update_one_slot(). XXX Hope there isn't a loophole in this. I'll buy the first person to point out a bug in the reasoning a beer. Backport candidate (but I won't do it).
* Moved inplace add and multiply methods from UserString to MutableString.Raymond Hettinger2002-08-094-11/+19
| | | | | Closes SF Bug #592573 where inplace add mutated a UserString. Added unittests to verify the bug is cleared.
* Moved special case for tuples from iterobject.c toRaymond Hettinger2002-08-092-25/+123
| | | | | | tupleobject.c. Makes the code in iterobject.c cleaner and speeds-up the general case by not checking for tuples everytime. SF Patch #592065.
* Revised the test suite for 'contains' to use the test() function argumentRaymond Hettinger2002-08-091-9/+9
| | | | | rather than vereq(). While it was effectively testing regular strings, it ignored the test() function argument when called by test_userstring.py.
* By popular demand the frameworkinstall target now installs everything:Jack Jansen2002-08-092-30/+51
| | | | | | | | | the framework, the MacOSX apps and the unix tools. Most of the hard work is done by Mac/OSX/Makefile. Also, it should now be possible to install in a different directory, such as /tmp/dist/Library/Frameworks, for building binary installers. The fink crowd wanted this.
* Significant speedup in new-style object creation: in slot_tp_new(),Guido van Rossum2002-08-081-1/+8
| | | | | | | | | intern the string "__new__" so we can call PyObject_GetAttr() rather than PyObject_GetAttrString(). (Though it's a mystery why slot_tp_new is being called when a class doesn't define __new__. I'll look into that tomorrow.) 2.2 backport candidate (but I won't do it).
* Use hex escape for non-ascii chars, now that the parser wants that.Jack Jansen2002-08-081-13/+13
| | | | | Good thing, too: some of the characters had been mangled by OS9->CVS->OSX roundtrips.
* A modest speedup of object deallocation. call_finalizer() did ratherGuido van Rossum2002-08-082-66/+71
| | | | | | | | | | | | | | | a lot of work: it had to save and restore the current exception around a call to lookup_maybe(), because that could fail in rare cases, and most objects don't have a __del__ method, so the whole exercise was usually a waste of time. Changed this to cache the __del__ method in the type object just like all other special methods, in a new slot tp_del. So now subtype_dealloc() can test whether tp_del is NULL and skip the whole exercise if it is. The new slot doesn't need a new flag bit: subtype_dealloc() is only called if the type was dynamically allocated by type_new(), so it's guaranteed to have all current slots. Types defined in C cannot fill in tp_del with a function of their own, so there's no corresponding "wrapper". (That functionality is already available through tp_dealloc.)
* The other half of the patches added to SF patch 555085 by A IGuido van Rossum2002-08-081-0/+2
| | | | | | MacIntyre. At least on OS/2, a subsequent connect() on a nonblocking socket returns errno==EISCONN to indicate success. This seems harmless on Unix.
* Clean up some docstrings. Some docstrings didn't show their returnGuido van Rossum2002-08-081-10/+11
| | | | | | value; others were inconsistent in what to name the argument or return value; a few module-global functions had "socket." in front of their name, against convention.
* testSendAll(): loop until all data is read; this was necessary atGuido van Rossum2002-08-081-3/+3
| | | | | | least on OS/2 (see note on SF patch 555085 by A I MacIntyre) but looks like the test *could* fail on any other platform too -- there's no guarantee that recv() reads all data.
* Whitespace normalization.Tim Peters2002-08-0883-5828/+5817
|
* Delete junk attributes left behind by _socketobject class construction.Tim Peters2002-08-081-0/+1
|
* Patch #588561: Cygwin _hotshot patchJason Tishler2002-08-081-2/+4
| | | | | | YA Cygwin module patch very similar to other patches that I have submitted. I tested under Cygwin and Red Hat Linux 7.1.
* The _socketobject class has no need for a __del__ method: all it did wasGuido van Rossum2002-08-081-10/+6
| | | | | | | to delete the reference to self._sock, and the regular destructor will do that just fine. This made some hacks in close() unnecessary. The _fileobject class still has a __del__ method, because it must flush.
* OK, one more hack: speed up the case of readline() in unbuffered mode.Guido van Rossum2002-08-081-0/+11
| | | | This is important IMO because httplib reads the headers this way.
* Another refactoring of read() and readline(), this time based on theGuido van Rossum2002-08-081-66/+88
| | | | | | | | observation that _rbuf could never have more than one string in it. So make _rbuf a string. The code branches for size<0 and size>=0 are completely separate now, both in read() and in readline(). I checked for tabs this time. :-)
* Extend __all__ with the exports list of the _ssl module.Guido van Rossum2002-08-081-1/+4
|
* Oops, stupid tabs. Sorry again.Guido van Rossum2002-08-081-3/+3
|
* Another refactoring. Changed 'socket' from being a factory functionGuido van Rossum2002-08-081-26/+49
| | | | | | | | | | | | to being a new-style class, to be more similar to the socket class in the _socket module; it is now the same as the _socketobject class. Added __slots__. Added docstrings, copied from the real socket class where possible. The _fileobject class is now also a new-style class with __slots__ (though without docstrings). The mode, name, softspace, bufsize and closed attributes are properly supported (closed as a property; name as a class attributes; the softspace, mode and bufsize as slots).
* Add module-wide "__metaclass__ = type", as requested by Jim Fulton.Steve Purcell2002-08-081-1/+4
| | | | (Synched from pyunit CVS)
* Added info about highwater heap-memory use for the sortperf.py tests; + aTim Peters2002-08-081-3/+31
| | | | couple of minor edits elsewhere.
* PyList_Reverse(): This was leaking a reference to Py_None on every call.Tim Peters2002-08-081-1/+4
| | | | | I believe I introduced this bug when I refactored the reversal code so that the mergesort could use it too. It's not a problem on the 2.2 branch.
* Major restructuring of _fileobject. Hopefully several things now workGuido van Rossum2002-08-081-61/+111
| | | | | | | | correctly (the test at least succeed, but they don't test everything yet). Also fix a performance problem in read(-1): in unbuffered mode, this would read 1 byte at a time. Since we're reading until EOF, that doesn't make sense. Use the default buffer size if _rbufsize is <= 1.
* Replace docstrings on test functions witrh comments -- then unittestGuido van Rossum2002-08-081-31/+50
| | | | | | | | | | | | | prints function and module names, which is more informative now that we repeat some tests in slightly modified subclasses. Add a test for read() until EOF. Add test suites for line-buffered (bufsize==1) and a small custom buffer size (bufsize==2). Restructure testUnbufferedRead() somewhat to avoid a potentially infinite loop.
* Added info about the right way to leave the body of a trashcan-protectedTim Peters2002-08-071-0/+5
| | | | destructor early.
* Fix a subtle bug in the trashcan code I added yesterday toGuido van Rossum2002-08-071-2/+3
| | | | | | | | | | | | | | | | | | | | | | | subtype_dealloc(). When call_finalizer() failed, it would return without going through the trashcan end macro, thereby unbalancing the trashcan nesting level counter, and thereby defeating the test case (slottrash() in test_descr.py). This in turn meant that the assert in the GC_UNTRACK macro wasn't triggered by the slottrash() test despite a bug in the code: _PyTrash_destroy_chain() calls the dealloc routine with an object that's untracked, and the assert in the GC_UNTRACK macro would fail on this; but because of an earlier test that resurrects an object, causing call_finalizer() to fail and the trashcan nesting level to be unbalanced, so _PyTrash_destroy_chain() was never called. Calling the slottrash() test in isolation *did* trigger the assert, however. So the fix is twofold: (1) call the GC_UnTrack() function instead of the GC_UNTRACK macro, because the function is safe when the object is already untracked; (2) when call_finalizer() fails, jump to a label that exits through the trashcan end macro, keeping the trashcan nesting balanced.
* GvR pointed out that only enclosing function bodies are part of nested scopes.Raymond Hettinger2002-08-071-5/+5
|
* Add -E and -tt options to the python invocations, as for the Unix tests.Guido van Rossum2002-08-071-2/+2
| | | | | The -tt means modules that mix tabs and spaces will be rejected. The -E refuses to believe Python options in the environment.
* Replace tabs with spaces. (Sorry!)Guido van Rossum2002-08-071-3/+3
|
* Tighten the unbuffered readline test to distinguish between the two lines.Guido van Rossum2002-08-071-4/+4
|
* Simplify heapreplace() -- there's no need for an explicit test forGuido van Rossum2002-08-071-7/+4
| | | | empty heap, since heap[0] raises the appropriate IndexError already.
* Document that heappop() and heapreplace() raise IndexError if the heapGuido van Rossum2002-08-071-1/+2
| | | | is empty.
* Apply character{} markup.Raymond Hettinger2002-08-071-16/+17
|
* Replace abort with Py_FatalError.Martin v. Löwis2002-08-072-2/+2
|
* Described responsibilty of weakly referenced extension types to initializeRaymond Hettinger2002-08-071-2/+23
| | | | | the weakreflist to NULL in the constructor and to fill the tp_flags slot with Py_TPFLAGS_HAVE_WEAKREFS. Closes SF bug 586583.
* Describe nested scopes in the tutorial. Closes SF bug 500704.Raymond Hettinger2002-08-071-6/+11
|
* Oops. I accidentally commented out some tests.Guido van Rossum2002-08-071-4/+4
|
* Regenerated with OSA class inheritance and fix for non-ascii chars.Jack Jansen2002-08-0742-818/+2217
|
* Fixed incorrect logic in determining whether we should initializeJack Jansen2002-08-071-2/+1
| | | | the classes' attribute list.
* Documented os.fsync and os.fdatasync. Closes SF bug 584695.Raymond Hettinger2002-08-071-0/+11
|
* "Unbuffered" mode of class _fileobject wasn't actually unbuffered,Guido van Rossum2002-08-072-8/+40
| | | | | | | | | | and this broke a Zope "pipelining" test which read multiple responses from the same connection (this attaches a new file object to the socket for each response). Added a test for this too. (I want to do some code cleanup too, but I thought I'd first fix the problem with as little code as possible, and add a unit test for this case. So that's what this checkin is about.)
* - If an OSA identifier is a Python reserved word we now append an _Jack Jansen2002-08-071-8/+10
| | | | | | in stead of prepending it, which messes up "import * from". - A few ascii()s added again. - Changed the getbaseclasses a little, but it still isn't perfect.