summaryrefslogtreecommitdiff
path: root/Lib/socket.py
AgeCommit message (Collapse)AuthorLines
2003-06-14Always unwrap _socketobj in socket.ssl. Revert httplib.py 1.25.Martin v. Löwis-10/+6
Fixes #754447.
2003-05-29I saw errors from _fileobject.__del__ about missing self._sock. ThisGuido van Rossum-1/+5
can happen if __init__ doesn't complete. Fix it by adding a try/except to __del__.
2003-05-10Patch #734231: Update RiscOS support. In particular, correctMartin v. Löwis-1/+3
riscospath.extsep, and use os.extsep throughout.
2003-04-29Extract the errno value to use from the errno module if possible.Fred Drake-1/+6
2003-04-29Regain throughput lost with the _socketobject wrapper. TheSkip Montanaro-3/+9
throughput-sensitive methods are grabbed from the underlying _socket.socket object. Closes SF patch 729293.
2003-04-25Patch by Jp Calderone:Guido van Rossum-0/+1
- The socket module now provides the functions inet_pton and inet_ntop for converting between string and packed representation of IP addresses. See SF patch #658327. This still needs a bit of work in the doc area, because it is not available on all platforms (especially not on Windows).
2003-03-30The socket module now always uses the _socketobject wrapper class, even onSkip Montanaro-5/+1
platforms which have dup(2). The makefile() method is built directly on top of the socket without duplicating the file descriptor, allowing timeouts to work properly. Includes a new test case (urllibnet) which requires the network resource. Closes bug 707074.
2002-08-22On Windows, make sure SocketType is the same as socket. (SF bugGuido van Rossum-1/+1
598097)
2002-08-08Delete junk attributes left behind by _socketobject class construction.Tim Peters-0/+1
2002-08-08The _socketobject class has no need for a __del__ method: all it did wasGuido van Rossum-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.
2002-08-08OK, one more hack: speed up the case of readline() in unbuffered mode.Guido van Rossum-0/+11
This is important IMO because httplib reads the headers this way.
2002-08-08Another refactoring of read() and readline(), this time based on theGuido van Rossum-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. :-)
2002-08-08Extend __all__ with the exports list of the _ssl module.Guido van Rossum-1/+4
2002-08-08Oops, stupid tabs. Sorry again.Guido van Rossum-3/+3
2002-08-08Another refactoring. Changed 'socket' from being a factory functionGuido van Rossum-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).
2002-08-08Major restructuring of _fileobject. Hopefully several things now workGuido van Rossum-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.
2002-08-07Replace tabs with spaces. (Sorry!)Guido van Rossum-3/+3
2002-08-07"Unbuffered" mode of class _fileobject wasn't actually unbuffered,Guido van Rossum-2/+5
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.)
2002-07-31Restore a full arglist to the socket wrapper, so it supports keywordTim Peters-2/+2
arguments correctly too.
2002-07-31For platforms (like Windows) that wrap _socket.socket:Tim Peters-2/+3
+ Don't change the arglist requirements. + Give the wrapper the same docstring as _socket.socket (it didn't have any docstring).
2002-07-18Add default timeout functionality. This adds setdefaulttimeout() andGuido van Rossum-0/+2
getdefaulttimeout() functions to the socket and _socket modules, and appropriate tests.
2002-06-13Cleanup a littleNeal Norwitz-6/+7
2002-06-06SF patch 555085 (timeout socket implementation) by Michael Gilfix.Guido van Rossum-58/+73
I've made considerable changes to Michael's code, specifically to use the select() system call directly and to store the timeout as a C double instead of a Python object; internally, -1.0 (or anything negative) represents the None from the API. I'm not 100% sure that all corner cases are covered correctly, so please keep an eye on this. Next I'm going to try it Windows before Tim complains. No way is this a bugfix candidate. :-)
2002-02-17Repair so that importing socket doesn't blow up on platforms that lackTim Peters-7/+12
SSL support. test_socket.py passes again on Windows. Added an XXX about adding _ssl exports to the __all__ list (it doesn't appear to be doing anything about that now, but since I don't have SSL on this box I can't really tell).
2002-02-16The Grande 'sendall()' patch, copied from release21-maint. Fixes #516715.Martin v. Löwis-2/+2
Replaces calls to socket.send() (which isn't guaranteed to send all data) with the new socket.sendall() method.
2002-02-16Break SSL support out of _socket module and place it into a newMarc-André Lemburg-1/+5
helper module _ssl. The support for the RAND_* APIs in _ssl is now only enabled for OpenSSL 0.9.5 and up since they were added in that release. Note that socketmodule.* should really be renamed to _socket.* -- unfortunately, this seems to lose the CVS history of the file. Please review and test... I was only able to test the header file chaos in socketmodule.c/h on Linux. The test run through fine and compiles don't give errors or warnings. WARNING: This patch does *not* include changes to the various non-Unix build process files.
2001-12-18Move the helper class _closedsocket *into* the _socketobject class.Guido van Rossum-7/+6
This way, when a socket object is deleted after the socket module has already been zapped by module shutdown, we don't get annoying warnings about exceptions in __del__ methods.
2001-10-29Add 'sendall' to list of socket methods.Guido van Rossum-1/+1
2001-10-24SF patch #474590 -- RISC OS supportGuido van Rossum-1/+1
2001-08-18Inspired by Greg Stein's proposed simplification of the _closesocketGuido van Rossum-5/+1
class, I came up with an even simpler solution: raise the error in __getattr__().
2001-08-18When the socket is closed, don't just assign 0 to self._sock.Guido van Rossum-8/+18
This breaks software that excepts a socket.error but not an AttributeError.
2001-03-29Whitespace normalization.Tim Peters-1/+1
2001-03-22Add a wrapper function for ssl() on Windows. Inspired by SF patchGuido van Rossum-6/+11
# 409287, ssl fix when using _socketobject, by Robin Dunn. I took the opportunity to improve the way it deals with reload(socket) for the socket function as well.
2001-03-18add errorTab to __all__ on win*Skip Montanaro-0/+1
closes bug #406642
2001-03-02RISCOS changes by dschwertberger.Guido van Rossum-1/+2
2001-02-15bunch more __all__ listsSkip Montanaro-0/+5
also modified check_all function to suppress all warnings since they aren't relevant to what this test is doing (allows quiet checking of regsub, for instance)
2001-01-15Whitespace normalization.Tim Peters-1/+1
2000-09-30Mention in the module's doc string that other functions of the socket APIMartin v. Löwis-1/+2
appear as methods on socket objects.
2000-09-19Support sizehint in _fileobject.readlines, as documented.Martin v. Löwis-1/+5
2000-09-15Before comparing os.uname() to BeOS check that os.uname actually exists:-)Jack Jansen-1/+1
2000-08-16updated occurences of fqdn algorithm (closes patch #101197)Peter Schneider-Kamp-1/+1
2000-08-16Revise the wrapper structure for the socket module:Fred Drake-0/+237
socket.py is used for all platforms, and it defines the additional classes and alternate socket() function for Windows and BeOS systems. The plat-*/socket.py files are no longer needed, since there is a shared socket.py. make_fqdn() is provided, but I decided to call it getfqdn() to be consistent with the other names in the socket module. Since it is really a "get" operation and does not create a new name, this is the right name to give it. Move the docstring here from the _socket module.