Bill Janssen [Wed, 29 Aug 2007 22:35:05 +0000 (22:35 +0000)]
This contains a number of things:
1) Improve the documentation of the SSL module, with a fuller
explanation of certificate usage, another reference, proper
formatting of this and that.
2) Fix Windows bug in ssl.py, and general bug in sslsocket.close().
Remove some unused code from ssl.py. Allow accept() to be called on
sslsocket sockets.
3) Use try-except-else in import of ssl in socket.py. Deprecate use of
socket.ssl().
4) Remove use of socket.ssl() in every library module, except for
test_socket_ssl.py and test_ssl.py.
Thomas Wouters [Tue, 28 Aug 2007 15:28:19 +0000 (15:28 +0000)]
Improve extended slicing support in builtin types and classes. Specifically:
- Specialcase extended slices that amount to a shallow copy the same way as
is done for simple slices, in the tuple, string and unicode case.
- Specialcase step-1 extended slices to optimize the common case for all
involved types.
- For lists, allow extended slice assignment of differing lengths as long
as the step is 1. (Previously, 'l[:2:1] = []' failed even though
'l[:2] = []' and 'l[:2:None] = []' do not.)
- Implement extended slicing for buffer, array, structseq, mmap and
UserString.UserString.
- Implement slice-object support (but not non-step-1 slice assignment) for
UserString.MutableString.
Guido van Rossum [Mon, 27 Aug 2007 18:42:23 +0000 (18:42 +0000)]
> Some of the code sets the error string in this directly before
> returning NULL, and other pieces of the code call PySSL_SetError,
> which creates the error string. I think some of the places which set
> the string directly probably shouldn't; instead, they should call
> PySSL_SetError to cons up the error name directly from the err code.
> However, PySSL_SetError only works after the construction of an ssl
> object, which means it can't be used there... I'll take a longer look
> at it and see if there's a reasonable fix.
Here's a patch which addresses this. It also fixes the indentation in
PySSL_SetError, bringing it into line with PEP 7, fixes a compile warning
about one of the OpenSSL macros, and makes the namespace a bit more
consistent. I've tested it on FC 7 and OS X 10.4.
% ./python ./Lib/test/regrtest.py -R :1: -u all test_ssl
test_ssl
beginning 6 repetitions
123456
......
1 test OK.
[29244 refs]
%
[GvR: slightly edited to enforce 79-char line length, even if it required
violating the style guide.]
Guido van Rossum [Mon, 27 Aug 2007 17:19:42 +0000 (17:19 +0000)]
> Regardless, building a fixed test certificate and checking it in sounds like
> the better option. Then the openssl command in the test code can be turned
> into a comment describing how the test data was pregenerated.
Facundo Batista [Mon, 27 Aug 2007 01:15:34 +0000 (01:15 +0000)]
Ignore test failures caused by 'resource temporarily unavailable'
exceptions raised in the test server thread, since SimpleXMLRPCServer
does not gracefully handle them. Changed number of requests handled
by tests server thread to one (was 2) because no tests require more
than one request. [GSoC - Alan McIntyre]
Neal Norwitz [Sun, 26 Aug 2007 22:20:03 +0000 (22:20 +0000)]
Another patch from Bill Janssen that:
1) Fixes the bug that two class names are initial-lower-case.
2) Replaces the poll waiting for the server to become ready with
a threading.Event signal.
Neal Norwitz [Sun, 26 Aug 2007 06:29:57 +0000 (06:29 +0000)]
Reap children before the test starts so hopefully SocketServer
won't find any old children left around which causes an exception
in collect_children() and the test to fail.
Gregory P. Smith [Sun, 26 Aug 2007 00:26:00 +0000 (00:26 +0000)]
keep setup.py from listing unneeded hash modules (_md5, _sha*) as
missing when they were not built because _hashlib with openssl provided
their functionality instead.
Guido van Rossum [Sat, 25 Aug 2007 15:08:43 +0000 (15:08 +0000)]
Server-side SSL and certificate validation, by Bill Janssen.
While cleaning up Bill's C style, I may have cleaned up some code
he didn't touch as well (in _ssl.c).
Alex Martelli [Wed, 22 Aug 2007 21:14:17 +0000 (21:14 +0000)]
Fix compile.c so that it records 0.0 and -0.0 as separate constants in a code
object's co_consts tuple; add a test to show that the previous behavior (where
these two constants were "collapsed" into one) causes serious malfunctioning.
Facundo Batista [Tue, 21 Aug 2007 16:57:18 +0000 (16:57 +0000)]
Added test for behavior of operations on an unconnected SMTP object,
and tests for NOOP, RSET, and VRFY. Corrected typo in a comment for
testNonnumericPort. Added a check for constructing SMTP objects when
non-numeric ports are included in the host name. Derived a server from
SMTPServer to test various ESMTP/SMTP capabilities. Check that a
second HELO to DebuggingServer returns an error. [GSoC - Alan McIntyre]
Mark Hammond [Tue, 21 Aug 2007 01:05:16 +0000 (01:05 +0000)]
[ 1761786 ] distutils.util.get_platform() return value on 64bit Windows
As discussed on distutils-sig: Allows the generated installer name on
64bit Windows platforms to be different than the name generated for
32bit Windows platforms.
Mark Hammond [Tue, 21 Aug 2007 01:04:47 +0000 (01:04 +0000)]
[ 1761786 ] distutils.util.get_platform() return value on 64bit Windows
As discussed on distutils-sig: Allows the generated installer name on
64bit Windows platforms to be different than the name generated for
32bit Windows platforms.
Facundo Batista [Tue, 21 Aug 2007 00:16:21 +0000 (00:16 +0000)]
Catch ProtocolError exceptions and include the header information in
test output (to make it easier to debug test failures caused by
problems in the server). [GSoC - Alan McIntyre]
Guido van Rossum [Mon, 20 Aug 2007 15:18:04 +0000 (15:18 +0000)]
Add a hack (originally devised in a slightly different form by Thomas Wouters)
to prevent spurious tracebacks when a daemon thread's cleanup happens to wake
up when the world around it has already been destroyed.