[issue16914] timestamping in smtplib.py to help troubleshoot server timeouts/delays
Maciej Szulik added the comment: After talking to David I'm submitting the patch once again with one slight change in ACKS file (I've put the names in the sorted order). -- Added file: http://bugs.python.org/file39073/issue16914.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16914 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16914] timestamping in smtplib.py to help troubleshoot server timeouts/delays
R. David Murray added the comment: Review comments added. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16914 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16914] timestamping in smtplib.py to help troubleshoot server timeouts/delays
Roundup Robot added the comment: New changeset 65037930edb0 by R David Murray in branch 'default': #16914: add timestamps to smtplib debugging output via new debuglevel 2. https://hg.python.org/cpython/rev/65037930edb0 -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16914 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16914] timestamping in smtplib.py to help troubleshoot server timeouts/delays
Roundup Robot added the comment: New changeset de19c0ffe8d5 by R David Murray in branch 'default': News item for #16914. https://hg.python.org/cpython/rev/de19c0ffe8d5 -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16914 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16914] timestamping in smtplib.py to help troubleshoot server timeouts/delays
Maciej Szulik added the comment: Review comments addressed in latest patch. -- Added file: http://bugs.python.org/file39077/issue16914.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16914 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16914] timestamping in smtplib.py to help troubleshoot server timeouts/delays
R. David Murray added the comment: Thanks Gavin and Maciej. I can tell it is the end of the sprints...my brain is fuzzy and I forgot both the news item and missed the missing versionchanged when I reviewed -- resolution: - fixed stage: patch review - resolved status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16914 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16914] timestamping in smtplib.py to help troubleshoot server timeouts/delays
Roundup Robot added the comment: New changeset 724473a18ada by R David Murray in branch 'default': #16914: reflow paragraph and add missing versionchanged. https://hg.python.org/cpython/rev/724473a18ada -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16914 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16914] timestamping in smtplib.py to help troubleshoot server timeouts/delays
Roundup Robot added the comment: New changeset e532937914fc by R David Murray in branch 'default': #16914: fix test errors under -W error::BytesWarning. https://hg.python.org/cpython/rev/e532937914fc -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16914 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16914] timestamping in smtplib.py to help troubleshoot server timeouts/delays
Berker Peksag added the comment: Thanks Maciej. I left a couple of comments on Rietveld: http://bugs.python.org/review/16914/ -- nosy: +berker.peksag ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16914 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16914] timestamping in smtplib.py to help troubleshoot server timeouts/delays
Maciej Szulik added the comment: Uploading updated version of the patch. -- Added file: http://bugs.python.org/file38974/issue16914.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16914 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16914] timestamping in smtplib.py to help troubleshoot server timeouts/delays
Maciej Szulik added the comment: Moving this enhancement to python 3.5. I'm adding updated patch plus tests for debug messages, updated what's new docs -- nosy: +maciej.szulik versions: +Python 3.5 -Python 3.4 Added file: http://bugs.python.org/file38924/issue16914.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16914 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16914] timestamping in smtplib.py to help troubleshoot server timeouts/delays
gac added the comment: Thanks, I'll look into your suggestions and try to submit a further improved patch :) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16914 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16914] timestamping in smtplib.py to help troubleshoot server timeouts/delays
gac added the comment: Here's a second path I've done for the current/default branch, using a separate print function for output, as recommended by Berker Peksag. I tried to add it as a separate patch set using the code review tool but every time I did, I just got a screen full of debug output from Django so I'm going to attach it here instead. The for loop on args inside _print_debug probably isn't ideal, but I've done this to try and make sure that debuglevel 1 output is identical to what it was before my patches. Because args is passed into _print_debug as a tuple, I found that when doing print(message, args, file=stderr) it introduced the extra parentheses and quotes inherent with a tuple into the output. By concatenating string representations of this tuple onto the existing string it means the original output format is duplicated exactly. There may be a speed penalty for this, but realistically it seems that a minor speed penalty would be expected when using debugging options and the output consistency trumps raw speed for debugging. Once I've found a way of achieving the same in 2.7 (i.e. maintaining the original output format when being passed a tuple, the approach I've used for Python 3 doesn't seem to have the desired affect in 2.7) then I'll hopefully submit a patch for that as well. -- Added file: http://bugs.python.org/file28721/smtplib.34.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16914 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16914] timestamping in smtplib.py to help troubleshoot server timeouts/delays
R. David Murray added the comment: Thanks for the suggestion and patch. I haven't reviewed it thoroughly yet, but if you change _print_debug to be: def _print_debug(*args): then print(datetime.datetime.now(), *args, file=stderr) should do what you want for python3 (I don't think the [] are needed, personally). This patch won't be applied to 2.7, which I presume you know, so making that work would be for informational purposes only. -- versions: -Python 2.7 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16914 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16914] timestamping in smtplib.py to help troubleshoot server timeouts/delays
R. David Murray added the comment: Er, that should have been (self, *args), but actually I'd recommend making it a module function, not a method, in which case my signature would be correct :) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16914 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16914] timestamping in smtplib.py to help troubleshoot server timeouts/delays
gac added the comment: Patch to add the same functionality to Python 2.7, if anyone's interested in that also. -- versions: +Python 2.7 Added file: http://bugs.python.org/file28686/smtplib.py.27.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16914 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16914] timestamping in smtplib.py to help troubleshoot server timeouts/delays
New submission from gac: I had cause to use smtplib to help me pinpoint why some outgoing mail was failing, but found that while it offered verbose logging (via debuglevel 1) this was without timestamps, making it difficult to make my case to the server operator that it was a server-side delay causing the issue. I've changed smtplib.py to add a second debugging level which includes timestamps down to microsecond granularity so that the debug log produced can pinpoint when a server isn't responding promptly. debuglevel 1 is unchanged, so anyone depending on the output from this being in a particular format won't be affected (either by setting debuglevel to 1 or true), but if debuglevel 2 is used explicitly then the standard output is preceded by a timestamp. -- components: Library (Lib) files: smtplib.py.patch keywords: patch messages: 179538 nosy: gac priority: normal severity: normal status: open title: timestamping in smtplib.py to help troubleshoot server timeouts/delays type: enhancement versions: Python 3.4 Added file: http://bugs.python.org/file28667/smtplib.py.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16914 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16914] timestamping in smtplib.py to help troubleshoot server timeouts/delays
Changes by R. David Murray rdmur...@bitdance.com: -- components: +email nosy: +barry, r.david.murray stage: - patch review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16914 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com