[issue32680] smtplib SMTP instances missing a default sock attribute

2018-10-09 Thread Giampaolo Rodola'
Giampaolo Rodola' added the comment: PR merged for 3.8 branch. I don't think such a simple change deserves a backport for previous Python versions. Closing this out as resolved. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.8

[issue32680] smtplib SMTP instances missing a default sock attribute

2018-10-09 Thread Giampaolo Rodola'
Giampaolo Rodola' added the comment: New changeset 7b313971805ca9b53f181f7b97e5376d0b89dc06 by Giampaolo Rodola (Romuald Brunet) in branch 'master': bpo-32680 add default "sock" on SMTP objects (#5345) https://github.com/python/cpython/commit/7b313971805ca9b53f181f7b97e5376d0b89dc06 ---

[issue32680] smtplib SMTP instances missing a default sock attribute

2018-02-03 Thread amirjn
amirjn added the comment: apple.com -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.or

[issue32680] smtplib SMTP instances missing a default sock attribute

2018-02-03 Thread amirjn
amirjn added the comment: same problem at apple.com -- nosy: +amirjn ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubs

[issue32680] smtplib SMTP instances missing a default sock attribute

2018-01-26 Thread Stéphane Wirtel
Stéphane Wirtel added the comment: You are right, but... if there is an exception in the connect method before the init of self.sock, the sock attribute will not exist and in this case, and only in this case, there will be an exception in the close method. your code will work fine if you use a

[issue32680] smtplib SMTP instances missing a default sock attribute

2018-01-26 Thread Romuald Brunet
Romuald Brunet added the comment: My use case: try: s = SMTP('myhost') s.do_some_sending() finaly: if s is not None and s.sock is not None: s.quit() But I realize just now that in that case, if s was initialized correctly, its sock was inevitably set -- ___

[issue32680] smtplib SMTP instances missing a default sock attribute

2018-01-26 Thread Romuald Brunet
Change by Romuald Brunet : -- keywords: +patch pull_requests: +5192 stage: -> patch review ___ Python tracker ___ ___ Python-bugs-li

[issue32680] smtplib SMTP instances missing a default sock attribute

2018-01-26 Thread Romuald Brunet
New submission from Romuald Brunet : SMTP instances from the smtplib module are not creating their sock attribute consistently after __init__ When host is sent as parameter a sock object is created (and hopefully, connected) When the host is not sent, the sock attribute doesn't exist at all