| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
| |
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, :)
|
|
|
|
| |
change imports and other references. Closes #2925.
|
|
|
|
| |
Use the 3.0 module name to avoid spurious warnings.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
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.
|
|
|
|
| |
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.
|
| |
|
|
|
|
| |
the test itself doesn't do anything on windows, focus on setUp and tearDown.
|
|
|
|
|
|
| |
http://www.python.org/dev/buildbot/trunk/x86%20W2k8%20trunk/builds/255/step-test/0
Temporarily increase verbosity of this test.
|
| |
|
|
|
|
| |
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.
|
| |
|
|
|
|
| |
without TIPC
|
|
|
|
|
| |
for TIPC under Linux, see http://tipc.sf.net/ for more information.
Thanks to Alberto Bertogli for the patch
|
| |
|
| |
|
|
|
|
| |
You might want to review this change as it's my first time. Be gentle. :-)
|
|
|
|
| |
socket.recvfrom, which caused an ugly crash.
|
|
|
|
| |
for threading and socket serving.
|
|
|
|
|
|
| |
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).
|
|
|
|
|
| |
connection with an optional timeout, and modified httplib.py to
use this function in HTTPConnection. Applies patch 1676823.
|
| |
|
|
|
|
| |
return negative numbers, per the underlying C implementation.
|
|
|
|
|
| |
a socket operation on a socket with a timeout, the exception will be
caught correctly. Previously, the exception was not caught.
|
| |
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- 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.
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
| |
abstract namespace that is now fully supported.
|
|
|
|
| |
lookup to use the IP address returned by gethosbyname.
|
| |
|
| |
|
|
|
|
| |
properties.
|
|
|
|
| |
now exposed via new get...() methods.
|
| |
|
| |
|
|
|
|
|
|
|
| |
socket.gethostname() in the check for a valid return.
Also clarified docs (official and docstring) that the value from gethostname()
is returned if gethostbyaddr() doesn't do the job.
|
|
|
|
| |
of the test possiblities for testGetServBy().
|
| |
|
|
|
|
| |
service.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
a non-standard protocol and on a lower port than the tcp/udp entries,
which breaks the assumption that there will only be one service by a
given name on a given port when no protocol is specified.
Previous versions of this code have had other problems as a result of
different service definitions amongst common platforms. As this platform
has an extra, unexpected, service entry, I've special cased the platform
rather than re-order the list of services checked to highlight the pitfall.
|
|
|
|
| |
Windows (XP at least ;). Test in this order: echo, daytime, domain.
|
|
|
|
| |
getservbyname() optional. Update the tests and the docs.
|
| |
|