summaryrefslogtreecommitdiffstats
path: root/Lib
Commit message (Collapse)AuthorAgeFilesLines
* Whitespace normalization.Tim Peters2002-08-0883-5828/+5817
|
* Delete junk attributes left behind by _socketobject class construction.Tim Peters2002-08-081-0/+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)
* 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.
* 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.
* Oops. I accidentally commented out some tests.Guido van Rossum2002-08-071-4/+4
|
* "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.)
* Expanded the unittests for the new width sensitive PyUnicode_Contains().Raymond Hettinger2002-08-061-0/+6
|
* Add testcase for SF bug 574207 (chained __slots__ dealloc segfault).Guido van Rossum2002-08-061-0/+14
| | | | Fix forthcoming.
* Added a test for PyUnicode_Contains() taking into account the width ofBarry Warsaw2002-08-061-0/+1
| | | | Py_UNICODE.
* Add a coding cookie, because of the møøse quote.Guido van Rossum2002-08-061-0/+1
|
* Bump the LOOPS count. 50,000 iterations takes about 5 seconds on myGuido van Rossum2002-08-061-1/+1
| | | | machine -- that feels just right.
* Mark xreadlines deprecated. Don't use f.xreadlines() in test_iter.py.Guido van Rossum2002-08-062-2/+5
|
* Remove mention of deprecated xreadlines method.Guido van Rossum2002-08-061-1/+1
|
* Committing patch #591250 which provides "str1 in str2" when str1 is aBarry Warsaw2002-08-065-65/+88
| | | | string of longer than 1 character.
* Add next and __iter__ to the list of file methods that should raiseGuido van Rossum2002-08-061-1/+3
| | | | ValueError when called for a closed file.
* We only need to check for StopIteration here.Fred Drake2002-08-051-1/+1
|
* SF patch 590294: os._execvpe security fix (Zack Weinberg).Guido van Rossum2002-08-051-21/+6
| | | | | | | | | | | | | | 1) Do not attempt to exec a file which does not exist just to find out what error the operating system returns. This is an exploitable race on all platforms that support symbolic links. 2) Immediately re-raise the exception if we get an error other than errno.ENOENT or errno.ENOTDIR. This may need to be adapted for other platforms. (As a security issue, this should be considered for 2.1 and 2.2 as well as 2.3.)
* GvR provided solution to the socket rebinding timeout problem.Kurt B. Kaiser2002-08-053-7/+6
| | | | | | M PyShell.py M rpc.py M run.py
* Test whether a Cyrillic text correctly appears in a Unicode literal.Martin v. Löwis2002-08-051-0/+2
|
* We don't really need the name of the test in the "test skipped" msg, andTim Peters2002-08-041-1/+1
| | | | having it there causes the line to wrap.
* Oops! Forgot the closing paren.Tim Peters2002-08-041-1/+1
|
* Finally got around to figuring out and documenting why this test failsTim Peters2002-08-041-2/+10
| | | | | | | | on Windows. The test_sequence() ERROR is easily repaired if we're willing to add an os.unlink() line to mhlib's updateline(). The test_listfolders FAIL I gave up on -- I don't remember enough about Unix link esoterica to recall why a link count of 2 is something a well- written program should be keenly interested in <wink>.
* Add encoding declaration.Martin v. Löwis2002-08-042-1/+2
|
* Add encoding declaration.Martin v. Löwis2002-08-042-0/+2
|
* I don't know what's going on with this test, but the last change fromTim Peters2002-08-041-1/+1
| | | | | Piers obviously couldn't have passed on any platform. Fiddling it so it works (for a meaning of "works" no stronger than "doesn't fail" <wink>).
* - comment improvementAndrew MacIntyre2002-08-041-1/+25
| | | | - implement viable library search routine for EMX
* add parameter missing following Jeremy's compiler class refactoringAndrew MacIntyre2002-08-041-1/+1
|
* _siftup(): __le__ is now the only comparison operator used on arrayTim Peters2002-08-031-1/+1
| | | | elements.
* revert to version 1.2Piers Lauder2002-08-031-5/+6
|
* Added new heapreplace(heap, item) function, to pop (and return) theTim Peters2002-08-032-3/+20
| | | | | currently-smallest value, and add item, in one gulp. See the second N-Best algorithm in the test suite for a natural use.
* Large code rearrangement to use better algorithms, in the sense of needingTim Peters2002-08-031-39/+79
| | | | | | | | | | | | substantially fewer array-element compares. This is best practice as of Kntuh Volume 3 Ed 2, and the code is actually simpler this way (although the key idea may be counter-intuitive at first glance! breaking out of a loop early loses when it costs more to try to get out early than getting out early saves). Also added a comment block explaining the difference and giving some real counts; demonstrating that heapify() is more efficient than repeated heappush(); and emphasizing the obvious point thatlist.sort() is more efficient if what you really want to do is sort.
* Remove cut 'n paste silliness.Tim Peters2002-08-031-2/+0
|
* Minor fiddling, including a simple class to implement a heap iteratorTim Peters2002-08-032-10/+23
| | | | | in the test file. I have docs for heapq.heapify ready to check in, but Jack appears to have left behind a stale lock in the Doc/lib directory.
* Augment credits.Guido van Rossum2002-08-021-1/+1
|
* Hmm! I thought I checked this in before! Oh well.Tim Peters2002-08-022-10/+48
| | | | | | | | | | | | Added new heapify() function, which transforms an arbitrary list into a heap in linear time; that's a fundamental tool for using heaps in real life <wink>. Added heapyify() test. Added a "less naive" N-best algorithm to the test suite, and noted that this could actually go much faster (building on heapify()) if we had max-heaps instead of min-heaps (the iterative method is appropriate when all the data isn't known in advance, but when it is known in advance the tradeoffs get murkier).
* Add a PEP-263-style encoding turd^H^H^H^Hdeclaration, because there'sGuido van Rossum2002-08-021-0/+2
| | | | a c-cedilla in one of the docstrings.
* heappop(): Added comments; simplified and sped the code.Tim Peters2002-08-021-21/+19
|
* heappop(): Use "while True" instead of "while 1".Tim Peters2002-08-021-1/+1
|
* check_invariant(): Use the same child->parent "formula" used by heapq.py.Tim Peters2002-08-021-2/+2
|
* Don't use true division where int division was intended. For that matter,Tim Peters2002-08-022-2/+2
| | | | don't use division at all.