jadolg / webpymail

Automatically exported from code.google.com/p/webpymail
GNU General Public License v3.0
0 stars 0 forks source link

SMTP_SSL does not implemented in Python <= 2.5 #18

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Since the python 2.5 is mentiones in system requirement, I think there should 
be a workaround.
And SMTP_SSL in only in Python >= 2.6/3.0

Original issue reported on code.google.com by akimov.alex on 7 Sep 2010 at 8:32

GoogleCodeExporter commented 9 years ago
Right you are. Implemented this in a system with python 2.6. 

However I didn't find a workaround to get this working with python 2.5, do you 
have any pointers on this? - There are lots of systems still in 2.5 so I really 
don't want to bump the requirements. 

Original comment by hguerreiro@gmail.com on 8 Sep 2010 at 11:08

GoogleCodeExporter commented 9 years ago
Made a workaround to detect Python versions smaller than 2.6.5 (I've tested 
with 2.6.1 and it did not work). SMTP SSL support will only work for python 
versions >= 2.6.5. Closing this ticket.

Original comment by hguerreiro@gmail.com on 9 Sep 2010 at 10:22

GoogleCodeExporter commented 9 years ago
The thing is, SMTP_SSL depends not only on python version but also on compiling 
with or without SSL. So HAS_SMTP_SSL could be calculated like this:

try:
    from smtplib import SMTP_SSL
    HAS_SMTP_SSL = True
except ImportError:
    HAS_SMTP_SSL = False

Original comment by akimov.alex on 10 Sep 2010 at 10:45

GoogleCodeExporter commented 9 years ago
The problem here is that there are python versions in the wild with this bug:

http://bugs.python.org/issue4066 

It was because of this that I've used the version instead of trying to import. 
The affected versions will import SMTP_SSL and fail just the same.

However, I think that I'll adopt your solution and advice properly in the docs. 

Thank you!

Original comment by hguerreiro@gmail.com on 10 Sep 2010 at 6:52

GoogleCodeExporter commented 9 years ago
This issue was closed by revision r74.

Original comment by hguerreiro@gmail.com on 13 Sep 2010 at 7:44