On Sat, Nov 2, 2019 at 4:00 AM Yasuhito FUTATSUKI <futat...@poem.co.jp> wrote:
> It's too late, but it is a bit pity.... > > On 2019/10/30 0:11, Nathan Hartman wrote: > > <snip> > > After incorporating all the preceding feedback, the function is > > considerably longer, but we handle and report errors: > > > [[[> def finish(self): > > <snip> > > > finally: > > server.quit() > > ]]] > > As I mentioned before (but I couldn't tell what I want, sorry), > smtplib.SMTP.quit() can raise exception. If server.quit() in finally > block has raised an exception and it isn't caught, it will overwrite > the exception raised in try block or re-raised in exception block. Yes, you did say that before, but I forgot. :-( I'll fix it soon (when I'll be at my computer). The exception on server.quit() itself doesn't affect the result that > we could send message or not, and there is nothing we can do more > about this SMTP session. So we can catch it, then safely ignore it or > at most log its cause as warning, and continue the transaction. > Even if the cause of exception is fatal, It doesn't directly affect next > attempt to send message. Ok. Will do. Thank you for catching that!! Nathan