| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
| |
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
This is important IMO because httplib reads the headers this way.
|
|
|
|
|
|
|
|
| |
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. :-)
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
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).
|
|
|
|
| |
(Synched from pyunit CVS)
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
|
|
|
| |
empty heap, since heap[0] raises the appropriate IndexError already.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
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.)
|
| |
|
|
|
|
| |
Fix forthcoming.
|
|
|
|
| |
Py_UNICODE.
|
| |
|
|
|
|
| |
machine -- that feels just right.
|
| |
|
| |
|
|
|
|
| |
string of longer than 1 character.
|
|
|
|
| |
ValueError when called for a closed file.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.)
|
|
|
|
|
|
| |
M PyShell.py
M rpc.py
M run.py
|
| |
|
|
|
|
| |
having it there causes the line to wrap.
|
| |
|
|
|
|
|
|
|
|
| |
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>.
|
| |
|
| |
|
|
|
|
|
| |
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>).
|
|
|
|
| |
- implement viable library search routine for EMX
|
| |
|
|
|
|
| |
elements.
|
| |
|
|
|
|
|
| |
currently-smallest value, and add item, in one gulp. See the second
N-Best algorithm in the test suite for a natural use.
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
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).
|
|
|
|
| |
a c-cedilla in one of the docstrings.
|
| |
|
| |
|
| |
|
|
|
|
| |
don't use division at all.
|