Guido van Rossum
11ba094957
Major overhaul of timeout sockets:
...
- setblocking(0) and settimeout(0) are now equivalent, and ditto for
setblocking(1) and settimeout(None).
- Don't raise an exception from internal_select(); let the final call
report the error (this means you will get an EAGAIN error instead of
an ETIMEDOUT error -- I don't care).
- Move the select to inside the Py_{BEGIN,END}_ALLOW_THREADS brackets,
so other theads can run (this was a bug in the original code).
- Redid the retry logic in connect() and connect_ex() to avoid masking
errors. This probably doesn't work for Windows yet; I'll fix that
next. It may also fail on other platforms, depending on what
retrying a connect does; I need help with this.
- Get rid of the retry logic in accept(). I don't think it was needed
at all. But I may be wrong.
2002-06-13 15:07:44 +00:00
Guido van Rossum
dfad1a9039
Fix a typo.
...
Add a sleep (yuck!) to _testRecvFrom() so the server can set up first.
2002-06-13 15:03:01 +00:00
Guido van Rossum
ab659966db
Remove some overly complicated ways to concatenate and repeat strings
...
using "".join(). Fold a long line.
2002-06-12 21:29:43 +00:00
Guido van Rossum
284a2cf07f
Don't test for Java, test for sys.getrefcount.
2002-06-12 21:19:40 +00:00
Guido van Rossum
1c938014a3
Some provisional changes to get more tests to run on Windows (I hope).
2002-06-12 21:17:20 +00:00
Guido van Rossum
8e95ca85ae
Argh. Typo. :-(
2002-06-12 20:55:17 +00:00
Guido van Rossum
6fb3d5ee92
Allow absent fromfd(), for Windows.
2002-06-12 20:48:59 +00:00
Guido van Rossum
733632ac1f
testSetSockOpt() should not require the reuse flag to be 1 -- any
...
nonzero value is OK. Also fixed the error message for this and for
testGetSockOpt().
2002-06-12 20:46:49 +00:00
Guido van Rossum
7648968716
Lose the message on assertEqual calls -- they actually hide
...
information on what went wrong.
2002-06-12 20:38:30 +00:00
Guido van Rossum
24e4af8c72
New test suite for the socket module by Michael Gilfix.
...
Changed test_timeout.py to conform to the guidelines in Lib/test/README.
2002-06-12 19:18:08 +00:00
Guido van Rossum
67f7a38849
SF patch 555085 (timeout socket implementation) by Michael Gilfix.
...
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-06-06 21:08:16 +00:00
Finn Bock
ada1983950
Refcounting isn't available in Jython. Putting the jython test around it.
...
This closes patch "[ #490414 ] Jython and test_socket".
2001-12-09 08:57:46 +00:00
Barry Warsaw
4279346a9f
getnameinfo() appears to raise socket.error instead of
...
socket.gaierror. :( This allows test_socket to pass on a RH6.1-ish
Linux system.
2001-11-09 20:37:43 +00:00
Martin v. Löwis
06b1d21e7d
Correct getnameinfo refcounting and tuple parsing. Fixes #476648 .
2001-11-02 23:34:52 +00:00
Guido van Rossum
cb65688218
Test sendall().
2001-10-29 07:14:10 +00:00
Barry Warsaw
6870bba459
Make socket.getservbyname test optional on socket module having that
...
attribute. Jython does not have this function.
Closes SF patch #403667 .
2001-03-23 17:40:16 +00:00
Eric S. Raymond
83ff749827
String method conversion.
2001-02-09 12:03:45 +00:00
Fredrik Lundh
f785042433
a bold attempt to fix things broken by MAL's verify patch: import
...
'verify' iff it's used by a test module...
2001-01-17 21:51:36 +00:00
Marc-André Lemburg
3661908a6a
This patch removes all uses of "assert" in the regression test suite
...
and replaces them with a new API verify(). As a result the regression
suite will also perform its tests in optimization mode.
Written by Marc-Andre Lemburg. Copyright assigned to Guido van Rossum.
2001-01-17 19:11:13 +00:00
Fred Drake
132dce2246
Update the code to better reflect recommended style:
...
Use != instead of <> since <> is documented as "obsolescent".
Use "is" and "is not" when comparing with None or type objects.
2000-12-12 23:11:42 +00:00
Guido van Rossum
1bfdc78c84
Skip Montanaro: modify test_socket.py to listen/connect using loopback addr
2000-06-29 17:00:54 +00:00
Guido van Rossum
7e57bc4a5b
Fix the test so that connect() and bind() are called with a single
...
argument: a (host, port) tuple.
Like multi-arg append(), multi-arg connect() and bind() may be ruled out!
2000-03-24 20:54:29 +00:00
Guido van Rossum
41360a4696
Mass check-in after untabifying all files that need it.
1998-03-26 19:42:58 +00:00
Guido van Rossum
a008fa52be
Fixed test for socket.error to work when it's a class exception.
1997-10-01 04:39:05 +00:00
Fred Drake
cf3527b705
socket_type --> SocketType
1997-06-03 17:58:31 +00:00
Guido van Rossum
f8580215c1
Add test for presence of socket_type.
1997-05-21 14:38:57 +00:00
Guido van Rossum
9522274205
Increase the child's sleep time to 5 for slow machines.
1997-05-16 13:40:41 +00:00
Guido van Rossum
2b4d2800af
Suppress fork part of socket test when we can't fork.
1997-05-14 21:12:51 +00:00
Guido van Rossum
f518d5e98e
Print less in test_socket.
1997-05-09 01:54:45 +00:00
Guido van Rossum
fc167c6ba2
Did nobody ever notice that "make test" didn't print the summary line
...
any more? This was because the *parent* process in test_socket.py did
an os._exit(0)! Getting rid of that now...
1997-01-29 16:03:45 +00:00
Guido van Rossum
1d1394e660
Make as sure as we can that the forked child does not return and
...
continue the tests.
1997-01-17 16:13:15 +00:00
Barry Warsaw
dbfb8d4626
Rewrite the `hostname mismatch' test as per GvR suggestion.
...
Don't assume gethostbyaddr()'s primary hostname is the same as
gethostname(), or even that gethostname() can be found in the list of
hosts returned by gethostbyaddr(). We do test for at least one FQDN
in gethostbyaddr().
1997-01-13 19:35:39 +00:00
Barry Warsaw
dce1005908
Added an os._exit(0) in the parent so we don't have two test processes
...
after test_socket.py is run!
1997-01-07 21:02:06 +00:00
Barry Warsaw
cf3d4b5123
Test of the socket module. The following functions and methods are
...
not currently tested (or even touched):
# socket.fromfd()
# sktobj.getsockopt()
# sktobj.recvfrom()
# sktobj.sendto()
# sktobj.setblocking()
# sktobj.setsockopt()
# sktobj.shutdown()
1997-01-03 20:03:32 +00:00