Alexander Belopolsky added the comment: I noticed this part:
+ # We have an aware datetime. Use aware datetime arithmetic to find the + # seconds since the epoch. + delta = dt - datetime.datetime(*time.gmtime(0)[:6], + tzinfo=datetime.timezone.utc) + seconds = delta.total_seconds() Why don't you just return dt.astimezone() here? A round trip through a floating point timestamp always makes me nervous. I doubt loss of precision is a problem for the e-mail package, but who knows. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue665194> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com