socket.ssl() is deprecated

Paul Grove paul.a.grove at gmail.com
Fri Dec 3 15:02:05 UTC 2010


Hi I'm using offlineimap from git (about 2 weeks ago). There doesn't seem
to have been any commits since, so I'm presuming this hasn't been fixed
yet.

I'm getting socket.ssl() is deprecated messages on first start, and also
the whole script dies about once every 24 hours.

I have never coded python, but I took a stab at updating to use the ssl
module.

I've removed lines 161 to 165, and replaced them with:
        self.sslobj = ssl.wrap_socket(self.sock, keyfile=self.keyfile, certfile=self.certfile)

I also included ssl at the top of the file.

This seems to work fine, and only time will tell if this also fixes my
24ish hour crash problem.

Sorry for my laziness for not producing a patch to post here, but its a
simple non-perfect change.

It seems that using ssl.wrap_socket, there are a few methods that are
no longer used, and my change is also ignoring some version number
changes, but I'll have to leave this as an exercise to someone who
knows python and the code better.

If I still have problems with the random crash I'll look into the error
in detail and if needed post it here.

Hope this helps,

Regards,
Paul Grove
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 490 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/offlineimap-project/attachments/20101203/bdd627a6/attachment.pgp>


More information about the OfflineIMAP-project mailing list