socket.ssl() is deprecated

Sebastian Spaeth Sebastian at SSpaeth.de
Sat Dec 4 19:32:57 GMT 2010


On Fri, 03 Dec 2010 15:02:05 +0000, Paul Grove <paul.a.grove at gmail.com> wrote:
> I'm getting socket.ssl() is deprecated messages on first start, and also
> the whole script dies about once every 24 hours.
...
> I've removed lines 161 to 165, and replaced them with:
>         self.sslobj = ssl.wrap_socket(self.sock, keyfile=self.keyfile, certfile=self.certfile)

It would be nice to know which file you mean :-).

imaplibutil.py for example contains:
try:
    import ssl
    ssl_wrap = ssl.wrap_socket
except ImportError:
    ssl_wrap = socket.ssl

the reason is, I suspect that the ssl module was only included in python
2.6 and is not available in earlier versions. And as there are efforts
to keep offlineimap running on python 2.4, always including this will
not be possible.

BTW, this raises the question of python compatability that we want to
keep. If we bumped our minimum requirements to 2.5 or 2.6 we could do
some things easier, e.g. 2.6 would give us thread pools in the
multiprocess module and we could rely on the ssl module.2.6 has been
released on Oct 2008, so more than 2 years ago...

Sebastian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/offlineimap-project/attachments/20101204/3e9f0ea4/attachment-0001.sig>


More information about the OfflineIMAP-project mailing list