campaignmonitor / createsend-python

A Python library for the Campaign Monitor API
http://campaignmonitor.github.io/createsend-python
MIT License
57 stars 64 forks source link

Python 3.12+ compatibility - module 'ssl' has no attribute 'wrap_socket' #78

Open riklaunim opened 8 months ago

riklaunim commented 8 months ago

ssl.wrap_socket was deprecated since Python 3.7 and remove in 3.12 so for it to work with 3.12 SSLContext.wrap_socket has to be used.

https://pradyunsg-cpython-lutra-testing.readthedocs.io/en/latest/whatsnew/3.12.html

Tested for my use case and it seems to be working fine, although did not test with self.key_file/self.cert_file set which were undefined (and None in some test).

hronecviktor commented 6 months ago

:+1: For this, we need this merged ASAP too

PeterDekkers commented 4 months ago

@henrys-cm or anyone at CM, could you please review this?

This library doesn't work with Python 3.12+, which I assume is reasonably important.

mikemanger commented 1 month ago

I've tried emailing the support to hopefully get some action on this. One thing that is missing from this PR is it would be good to update tox to test against Python 3.11 and 3.12.

riklaunim commented 1 month ago

I've tried emailing the support to hopefully get some action on this. One thing that is missing from this PR is it would be good to update tox to test against Python 3.11 and 3.12.

That can be added, although someone with knowledge of the codebase has to look at this. Like those hasattr I had to use were quite unexpected.