[MERGE][1.9][bug 293054] Build the ssl socket in a python-2.6 compatible way *and* make the test suite passes again on OSX with python-2.6

Vincent Ladeuil v.ladeuil+lp at free.fr
Fri Nov 7 14:45:00 GMT 2008

>>>>> "john" == John Arbash Meinel <john at arbash-meinel.com> writes:


    john> +    def _dont_SIGQUIT_on_darwin(self):
    john> ^- Could we use SIGINT instead of SIGQUIT?

As Martin said, SIGQUIT is the expected signal and the logical
one to use. When I said 'Until we find a way to disable that
intrusive behavior', I was thinking as of OSX specific mean to
disable the popup (still had to find it, search it even :).


    john> So I did a check and on my python2.5 win32 install:

    john> $ py -c "import errno; print errno.ENOTCONN"
    john> 10057

    john> So it seems like doing:

    john> if not len(e.args) or e.args[0] != errno.ENOTCONN:
    john>   raise

    john> is a better way to do it anyway.

Can we conduct some more tests on the windows side and address
all the related places in one shot ? We have quite a few places
where we had to to handle windows specific error codes under hard
to reproduce circumstances, I don't want to break python-2.4
support for instance.

    john> ...

    john> -# FIXME: Should test for ssl availability
    john> +# Build the appropriate socket wrapper for ssl
    john> +try:
    john> +    import ssl # python 2.6
    john> +    _ssl_wrap_socket = ssl.wrap_socket
    john> +except ImportError:
    john> +    def _ssl_wrap_socket(sock, key_file, cert_file):
    john> +        ssl_sock = socket.ssl(sock, key_file, cert_file)
    john> +        return httplib.FakeSocket(sock, ssl_sock)
    john> +
    john> +
    john> ^- Can you add a comment like:
    john>   # python 2.4/2.5 don't have ssl and ssl.wrap_socket
    john>   # instead they use httplib.FakeSocket

Sure thing. 

More comments will be added here in the https-test-server branch,
but I will never refuse to add a comment asked for during a
review :-)

    john> BB:tweak

    john> I would also like to see this land in 1.9, but that is
    john> ultimately up to Martin.

He has already merged it, thanks Martin :)


More information about the bazaar mailing list