summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_socket.py
Commit message (Collapse)AuthorAgeFilesLines
* In a number of places code still reversRonald Oussoren2010-05-051-3/+2
| | | | | | | | | to "sys.platform == 'mac'" and that is dead code because it refers to a platform that is no longer supported (and hasn't been supported for several releases). Fixes issue #7908 for the trunk.
* Issue #7449, last part (11): fix many tests if thread support is disabledVictor Stinner2010-04-271-1/+16
| | | | | | * Use try/except ImportError or test_support.import_module() to import thread and threading modules * Add @unittest.skipUnless(threading, ...) to testcases using threads
* #7092 - Silence more py3k deprecation warnings, using ↵Florent Xicluna2010-03-211-7/+10
| | | | test_support.check_py3k_warnings() helper.
* Issue #8104: socket.recv_into() and socket.recvfrom_into() now supportAntoine Pitrou2010-03-171-4/+40
| | | | | writing into objects supporting the new buffer API, for example bytearrays or memoryviews.
* use assert[Not]In where appropriateEzio Melotti2010-01-231-1/+1
|
* Reverting the Revision: 77368. I committed Flox's big patch for tests bySenthil Kumaran2010-01-081-8/+4
| | | | mistake. ( It may come in for sure tough)
* Fixing - Issue7026 - RuntimeError: dictionary changed size during iteration. ↵Senthil Kumaran2010-01-081-4/+8
| | | | Patch by flox
* Fix testSourceAddress to not test the host, it wasn't passing on some platforms.Gregory P. Smith2010-01-031-9/+4
|
* Adds an optional source_address parameter to socket.create_connection().Gregory P. Smith2010-01-031-1/+14
| | | | For use by issue3972.
* http://bugs.python.org/issue6971Kristján Valur Jónsson2009-09-251-0/+4
| | | | Adding the SIO_KEEPALIVE_VALS command to socket.ioctl on windows
* #6944: the argument to PyArg_ParseTuple should be a tuple, otherwise a ↵Georg Brandl2009-09-191-1/+1
| | | | SystemError is set. Also clean up another usage of PyArg_ParseTuple.
* Fix issue1628205: Socket file objects returned by socket.socket.makefile() nowGregory P. Smith2009-08-131-0/+72
| | | | | properly handles EINTR within the read, readline, write & flush methods. The socket.sendall() method now properly handles interrupted system calls.
* convert usage of fail* to assert*Benjamin Peterson2009-06-301-28/+28
|
* Issue #1008086: Fixes socket.inet_aton() to always return 4 bytes evenGregory P. Smith2009-02-111-0/+8
| | | | on LP64 platforms (most 64-bit Linux, bsd, unix systems).
* - Issue #5104: The socket module now raises OverflowError when 16-bit port andGregory P. Smith2009-01-311-6/+30
| | | | | protocol numbers are supplied outside the allowed 0-65536 range on bind() and getservbyport().
* Comment typoMark Dickinson2009-01-151-1/+1
|
* Issue #4397. Fix occasional test_socket failure on OS X.Mark Dickinson2009-01-151-0/+4
|
* give the threading API PEP 8 namesBenjamin Peterson2008-06-111-1/+1
|
* Fixed the semantic of timeout for socket.create_connection andFacundo Batista2008-05-291-13/+19
| | | | | | all the upper level libraries that use it, including urllib2. Added and fixed some tests, and changed docs correspondingly. Thanks to John J Lee for the patch and the pusing, :)
* Queue renaming reversal part 3: move module into place andGeorg Brandl2008-05-251-2/+2
| | | | change imports and other references. Closes #2925.
* Added stub for the Queue module to be renamed in 3.0.Alexandre Vassalotti2008-05-111-2/+2
| | | | Use the 3.0 module name to avoid spurious warnings.
* Fix a bug introduced in r62627. see issue2760 and issue2632.Gregory P. Smith2008-05-051-0/+27
| | | | | | | | | | | | | An assertion in readline() would fail as data was already in the internal buffer even though the socket was in unbuffered read mode. That case is now handled. More importantly, read() has been fixed to not over-recv() and leave newly recv()d data in the _fileobject buffer. The max() vs min() issue in read() is now gone. Neither was correct. On bounded reads, always ask recv() for the exact amount of data we still need. Candidate for backporting to release25-maint along with r62627.
* - Issue #2550: The approach used by client/server code for obtaining portsTrent Nelson2008-04-081-28/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | to listen on in network-oriented tests has been refined in an effort to facilitate running multiple instances of the entire regression test suite in parallel without issue. test_support.bind_port() has been fixed such that it will always return a unique port -- which wasn't always the case with the previous implementation, especially if socket options had been set that affected address reuse (i.e. SO_REUSEADDR, SO_REUSEPORT). The new implementation of bind_port() will actually raise an exception if it is passed an AF_INET/SOCK_STREAM socket with either the SO_REUSEADDR or SO_REUSEPORT socket option set. Furthermore, if available, bind_port() will set the SO_EXCLUSIVEADDRUSE option on the socket it's been passed. This currently only applies to Windows. This option prevents any other sockets from binding to the host/port we've bound to, thus removing the possibility of the 'non-deterministic' behaviour, as Microsoft puts it, that occurs when a second SOCK_STREAM socket binds and accepts to a host/port that's already been bound by another socket. The optional preferred port parameter to bind_port() has been removed. Under no circumstances should tests be hard coding ports! test_support.find_unused_port() has also been introduced, which will pass a temporary socket object to bind_port() in order to obtain an unused port. The temporary socket object is then closed and deleted, and the port is returned. This method should only be used for obtaining an unused port in order to pass to an external program (i.e. the -accept [port] argument to openssl's s_server mode) or as a parameter to a server-oriented class that doesn't give you direct access to the underlying socket used. Finally, test_support.HOST has been introduced, which should be used for the host argument of any relevant socket calls (i.e. bind and connect). The following tests were updated to following the new conventions: test_socket, test_smtplib, test_asyncore, test_ssl, test_httplib, test_poplib, test_ftplib, test_telnetlib, test_socketserver, test_asynchat and test_socket_ssl. It is now possible for multiple instances of the regression test suite to run in parallel without issue.
* Revert r62152 (Issue #2550). Being able to observe the results of all the ↵Trent Nelson2008-04-041-76/+0
| | | | buildbots was certainly useful. All of the platforms that have some form of BSD lineage -- FreeBSD, OS X, Solaris and Tru64 -- all pass the test. Windows and Linux, on the other hand, don't. Windows I knew about, Linux was a surprise. Knowing this, I believe a more appropriate fix will revolve around test_support.bind_socket() -- this method needs to return a port that nothing in the system has bound already. The best way to do this may just be to rely on ephemeral ports, rather than having the user specify a desired port, then fall back to four random ports, then try 0.
* Issue 2550: extend test_socket.py to test SO_REUSEADDR semantics when bind() ↵Trent Nelson2008-04-041-0/+76
| | | | is called on identical (host, port) combinations in two separate sockets. This should raise an EADDRINUSE socket.error in all cases, irrespective of whether or not SO_REUSEADDR is set on the sockets. However, with Windows, when SO_REUSEADDR is set on the sockets, no error is thrown (an error is thrown when the option isn't set), which results in an extremely wedged python process whenever accept() is called on either of the bound sockets. I'm committing this test now to observe if it's only Windows that has this behaviour (via the buildbots). Note: this WILL break all Windows buildbots for now; once I've observed the results on other platforms, I'll revert, then start looking into a patch.
* Remove debug prints; the buildbot now passes the testsAmaury Forgeot d'Arc2008-04-021-14/+0
|
* Still investigating on the hanging test_socket.Amaury Forgeot d'Arc2008-03-291-2/+4
| | | | the test itself doesn't do anything on windows, focus on setUp and tearDown.
* The buildbot "x86 W2k8 trunk" seems to hang in test_socket.Amaury Forgeot d'Arc2008-03-291-0/+12
| | | | | | http://www.python.org/dev/buildbot/trunk/x86%20W2k8%20trunk/builds/255/step-test/0 Temporarily increase verbosity of this test.
* Print more information the next time test_socket throws the wrong exception.Jeffrey Yasskin2008-03-281-3/+7
|
* Disabled test_xmlrpc:test_404. It's causing lots of false alarms.Christian Heimes2008-01-191-1/+0
| | | | I also disabled a test in test_ssl which requires network access to svn.python.org. This fixes a bug Skip has reported a while ago.
* It's verbose, not debugChristian Heimes2008-01-081-1/+1
|
* Fixed indention problem that caused the second TIPC test to run on systems ↵Christian Heimes2008-01-071-1/+1
| | | | without TIPC
* Issue #1646: Make socket support TIPC. The socket module now has supportChristian Heimes2008-01-071-0/+82
| | | | | for TIPC under Linux, see http://tipc.sf.net/ for more information. Thanks to Alberto Bertogli for the patch
* socket.ioctl is only available on WindowsChristian Heimes2008-01-041-0/+10
|
* Enable platform-specific tweaks for FreeBSD 8 (exactly same to FreeBSD 7's yet)Hye-Shik Chang2007-10-281-1/+1
|
* Whitespace normalization. Ugh, we really need to do this more often.Neal Norwitz2007-04-251-6/+6
| | | | You might want to review this change as it's my first time. Be gentle. :-)
* Bug 1688393. Adds a control of negative values inFacundo Batista2007-03-281-0/+7
| | | | socket.recvfrom, which caused an ugly crash.
* Redone the tests, using the infrastructure already presentFacundo Batista2007-03-251-53/+65
| | | | for threading and socket serving.
* Surrounded with try/finally to socket's default timeout settingFacundo Batista2007-03-231-9/+11
| | | | | | changes in the tests, so failing one test won't produce strange results in others. Also relaxed the timeout settings in the test (where actually the value didn't mean anything).
* Added a 'create_connect()' function to socket.py, which creates aFacundo Batista2007-03-231-2/+83
| | | | | connection with an optional timeout, and modified httplib.py to use this function in HTTPConnection. Applies patch 1676823.
* Patch #1627441: close sockets properly in urllib2.Georg Brandl2007-01-211-1/+27
|
* Patch #1635058 by Mark Roberts: ensure that htonl and friends never accept orGuido van Rossum2007-01-141-0/+14
| | | | return negative numbers, per the underlying C implementation.
* Patch #1519025 and bug #926423: If a KeyboardInterrupt occurs duringNeal Norwitz2006-08-021-0/+32
| | | | | a socket operation on a socket with a timeout, the exception will be caught correctly. Previously, the exception was not caught.
* Release all forwarded functions in .close. Fixes #1513223.Martin v. Löwis2006-07-011-2/+17
|
* Prevent spurious leaks when running regrtest.py -R. There may be moreNeal Norwitz2006-06-181-0/+3
| | | | | | | | issues that crop up from time to time, but this change seems to have been pretty stable (no spurious warnings) for about a week. Other modules which use threads may require similar use of threading_setup/threading_cleanup from test_support.
* Fix the socket tests so they can be run concurrently. Backport candidateNeal Norwitz2006-06-121-2/+4
|
* Get test to pass on S/390. Shout if you think this change is incorrect.Neal Norwitz2006-06-111-1/+6
|
* Fixes in struct and socket from merge reviews.Martin Blais2006-06-041-6/+6
| | | | | | | | | | | | | - Following Guido's comments, renamed * pack_to -> pack_into * recv_buf -> recv_into * recvfrom_buf -> recvfrom_into - Made fixes to _struct.c according to Neal Norwitz comments on the checkins list. - Converted some ints into the appropriate -- I hope -- ssize_t and size_t.
* Support for buffer protocol for socket and struct.Martin Blais2006-05-261-1/+32
| | | | | | | | | | * Added socket.recv_buf() and socket.recvfrom_buf() methods, that use the buffer protocol (send and sendto already did). * Added struct.pack_to(), that is the corresponding buffer compatible method to unpack_from(). * Fixed minor typos in arraymodule.
* SF Patch #1062014: AF_UNIX sockets under Linux have a specialArmin Rigo2006-04-191-0/+28
| | | | abstract namespace that is now fully supported.