| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
Changes the way the httplib classes are stubbed out.
|
|
|
|
|
|
|
|
|
|
|
| |
The HTTP class is a backwards compatibility layer for the Python 1.5
API. (The only remaining use in the std library is xmlrpclib.)
The current change makes urllib issue HTTP/1.0 requests with
HTTPConnection, because is accesses HTTPResponse.fp directly instead
of using the read() method. Using fp directly interacts poorly with
persistent connections. There are probably better solutions than the
current one, but this is a start.
|
| |
|
|
|
|
|
|
|
| |
Add code to test_roundtrip() that figures out the encoding
from the first two lines of the file.
(We need to refactor this again to make it available to
all places that need this, e.g. linecache.py.)
|
|
|
|
|
| |
However, this will need to be fixed further to allow non-ASCII letters in
names; leaving this to MvL.
|
| |
|
|
|
|
| |
The httplib interface returns bytes for now.
|
|
|
|
| |
This change fixes a test in test_urllib.
|
| |
|
|
|
|
|
|
| |
In particular, watch out for comparing b"" to "". They're not equal,
but you can start at the code asking whether buf == "" for a long time
before realizing that it will never be True.
|
| |
|
|
|
|
|
|
|
|
|
| |
I'm not sure why I thought it should originally, but it introduces an
__del__() method on the response which cause the close() to be called
too soon using the HTTP compat class.
Also, remove some stale comments. The HTTPResponse calls makefile()
immediately, so there is no risk of it closing the socket.
|
|
|
|
|
| |
buffer. We just return 0 in this case now, like for all zero-length
reads.
|
| |
|
|
|
|
|
|
|
| |
Checks that an io object somewhere in the stack of wrappers is
actually closed. --This line, and those below, will be ignored--
M test_urllib2net.py
|
|
|
|
|
| |
Use io.BytesIO() instead of StringIO.StringIO(). FakeSocket still
accepts regular strings and coverts them to bytes internally.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If a makefile()-generated object is open and its parent socket is
closed, the parent socket should remain open until the child is
closed, too. The code to support this is moderately complex and
requires one extra slots in the socket object.
This change fixes httplib so that several urllib2net test cases pass
again.
Add SocketCloser class to socket.py, which encapsulates the
refcounting logic for sockets after makefile() has been called.
Move SocketIO class from io module to socket module. It's only use is
to implement the raw I/O methods on top of a socket to support
makefile().
Add unittests to test_socket to cover various patterns of close and
makefile.
|
| |
|
|
|
|
|
| |
raw socket so they can check the timeout value. Should change the
code under test to expose the timeout in a more direct way.
|
| |
|
|
|
|
|
|
| |
Fix test_cookielib and test_urllib2.
(The changes to urllib make urllib.quote() work correctly for Unicode
strings; but they don't fix test_urllib.)
|
|
|
|
|
| |
Fix for test_socketserver.
Use io.BytesIO instead of io.StringIO, and adjust tests.
|
|
|
|
| |
Fix test_zipimport.
|
| |
|
| |
|
| |
|
|
|
|
|
| |
using super(). (See recent conversation on python-3000 with Talin
and Phillip Eby about PEP 3115 chaining rules.)
|
| |
|
|
|
|
|
|
| |
In particular, add trivial implementations of .real, .imag and .conjugate()
to both, and add .numerator and .denominator to long.
Also some small optimizations (e.g. remove long_pos in favor of long_long).
|
|
|
|
| |
in KOI8-R.
|
|
|
|
|
|
| |
(The previous changes to abc.py were also by him).
Put back a comment about using super() for properties
(I didn't realize this worked).
|
|
|
|
|
| |
Add docstring for conjugate().
Patch by Jeffrey Yasskin.
|
| |
|
|
|
|
|
|
|
| |
error callback changes the bytes object in the exception the decoder might
use memory that's no longer in use. Change unicode_decode_call_errorhandler()
so that it fetches the adresses of the bytes array (start and end) from the
exception object and passes them back to the caller.
|
|
|
|
|
|
| |
string representation for use in the XML.
Also strip out some unneeded encoding/decoding steps.
|
|
|
|
| |
to be between str8 and str.
|
|
|
|
|
|
| |
Reported by Joe Smith. This makes the CYGWIN tests pass;
it's a miracle it didn't fail on other platforms.
Seems like it was accidentally dropped (maybe a merge artifact?).
|
| |
|
|
|
|
| |
encoding can only be UTF-8 now.
|
|
|
|
| |
Unicode now.
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
| |
In order to do this, I added an optional encoding argument to io.StringIO.
The toprettyxml() function returns bytes when you specify an encoding now.
|
|
|
|
| |
Fix one of the two failing tests for minidom.
|
| |
|
|
|
|
| |
Get rid of some #ifdef'ed-out code.
|