summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Fix test for new version of urllib that uses HTTPConnection directly.Jeremy Hylton2007-08-041-3/+3
| | | | Changes the way the httplib classes are stubbed out.
* Change urllib to use HTTPConnection rather than old HTTP class.Jeremy Hylton2007-08-042-24/+42
| | | | | | | | | | | 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.
* Make test_tokenize really pass -- don't add extra output.Guido van Rossum2007-08-041-2/+2
|
* Make test_tokenize pass again:Guido van Rossum2007-08-041-3/+14
| | | | | | | 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.)
* Fix an obvious bug caused by a switch to Unicode.Guido van Rossum2007-08-041-1/+2
| | | | | However, this will need to be fixed further to allow non-ASCII letters in names; leaving this to MvL.
* Fix test: readline() now returns bytesJeremy Hylton2007-08-041-2/+2
|
* Fix tests that tried to sneak strings through httplib.Jeremy Hylton2007-08-041-13/+13
| | | | The httplib interface returns bytes for now.
* Make sure LineAndFileWrapper gets bytes() as its first argument.Jeremy Hylton2007-08-041-3/+5
| | | | This change fixes a test in test_urllib.
* Use BytesIO instead of StringIO.Jeremy Hylton2007-08-041-3/+1
|
* Fix several more paths from the SSL code.Jeremy Hylton2007-08-041-15/+14
| | | | | | 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.
* Change read() on SSL socket to return bytes.Jeremy Hylton2007-08-041-4/+7
|
* HTTPResponse should not inherit from io.IOBase.Jeremy Hylton2007-08-041-6/+2
| | | | | | | | | 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.
* Get rid of a bogus assert when recv_into() is called with a zero-lengthGuido van Rossum2007-08-031-1/+4
| | | | | buffer. We just return 0 in this case now, like for all zero-length reads.
* Fix failure do to outlawing complex floordiv/mod.Guido van Rossum2007-08-031-1/+3
|
* Fix an absurdly invasive test.Jeremy Hylton2007-08-031-3/+1
| | | | | | | 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
* Fix tests to use bytes() where the actual sockets return bytes().Jeremy Hylton2007-08-031-6/+8
| | | | | Use io.BytesIO() instead of StringIO.StringIO(). FakeSocket still accepts regular strings and coverts them to bytes internally.
* Make test_complex pass again now that floordiv and mod are illegal.Guido van Rossum2007-08-031-12/+7
|
* Make sure socket.close() doesn't interfere with socket.makefile().Jeremy Hylton2007-08-033-39/+148
| | | | | | | | | | | | | | | | | | | | 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.
* Treat HTTP status line as ISO-8859-1 as in httplib module.Jeremy Hylton2007-08-031-1/+1
|
* Hack: Fix some test_urllib2.net tests by getting them access to theJeremy Hylton2007-08-031-10/+12
| | | | | raw socket so they can check the timeout value. Should change the code under test to expose the timeout in a more direct way.
* A few local changes for consistency of string literals.Jeremy Hylton2007-08-031-4/+5
|
* SF patch# 1762940 by Joe Gregorio.Guido van Rossum2007-08-034-14/+24
| | | | | | 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.)
* SF patch# 1764815 by Paul Colomiets.Guido van Rossum2007-08-032-6/+6
| | | | | Fix for test_socketserver. Use io.BytesIO instead of io.StringIO, and adjust tests.
* SF patch# 1766592 by Paul Colomiets.Guido van Rossum2007-08-034-25/+31
| | | | Fix test_zipimport.
* Convert print statements to function calls in Tools/.Collin Winter2007-08-0366-780/+778
|
* Make consistent use of "" for string literals in new classes.Jeremy Hylton2007-08-031-18/+18
|
* Fix status line parsing for http response.Jeremy Hylton2007-08-031-2/+7
|
* Add a default __prepare__() method to 'type', so it can be calledGuido van Rossum2007-08-022-0/+33
| | | | | using super(). (See recent conversation on python-3000 with Talin and Phillip Eby about PEP 3115 chaining rules.)
* Remove useless \withsubitem.Georg Brandl2007-08-021-1/+0
|
* Changes to long and float by Jeffrey Jasskin to conform to PEP 3141.Guido van Rossum2007-08-012-35/+54
| | | | | | 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).
* When testing all stdlib modules, ignore test_pep263.py which is encodedGuido van Rossum2007-08-011-0/+3
| | | | in KOI8-R.
* Tests for @abstractproperty by Jeffrey Yasskin.Guido van Rossum2007-08-012-18/+36
| | | | | | (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).
* Kill div, mod and divmod on complex (already deprecated in 2.x).Guido van Rossum2007-08-011-55/+15
| | | | | Add docstring for conjugate(). Patch by Jeffrey Yasskin.
* Add @abstractproperty.Guido van Rossum2007-08-011-0/+25
|
* Bytes (which are the input for decoding) are mutable now. If a decodingWalter Dörwald2007-07-302-19/+68
| | | | | | | 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.
* In cases where dealing with base64, do the conversion but then get the ASCIIBrett Cannon2007-07-301-7/+6
| | | | | | string representation for use in the XML. Also strip out some unneeded encoding/decoding steps.
* Don't try to use a bytes sequence for file paths. Also force equivalency testsBrett Cannon2007-07-301-1/+3
| | | | to be between str8 and str.
* Add a missing "rf.depth = 0;" to marshal_load().Guido van Rossum2007-07-301-0/+1
| | | | | | 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?).
* Implement PEP 3120.Martin v. Löwis2007-07-295-6/+69
|
* Testing against a different default encoding is meaningless as the defaultBrett Cannon2007-07-291-39/+0
| | | | encoding can only be UTF-8 now.
* Expat parser no longer has a returns_unicode attribute since everything isBrett Cannon2007-07-291-2/+0
| | | | Unicode now.
* Use BytesIO instead of cStringIO.StringIO.Martin v. Löwis2007-07-281-5/+5
|
* Revert previous checkin.Martin v. Löwis2007-07-281-7/+7
|
* Fix quopri to operate consistently on bytes.Martin v. Löwis2007-07-282-75/+87
|
* Return bytes, not str8.Martin v. Löwis2007-07-281-7/+7
|
* Patch #1762412: Fix test case for struni branch.Martin v. Löwis2007-07-281-44/+20
|
* Fix the minidom test.Guido van Rossum2007-07-273-24/+21
| | | | | 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.
* SF patch# 1759922 by Alexandre Vassalotti.Guido van Rossum2007-07-271-6/+1
| | | | Fix one of the two failing tests for minidom.
* Make test_sgmllib pass on OSX. Hopefully it still passes everywhere else too.Guido van Rossum2007-07-271-1/+1
|
* Fix the docstrings for keys(), items(), values() (especially the latter).Guido van Rossum2007-07-271-61/+6
| | | | Get rid of some #ifdef'ed-out code.