[issue11380] Improve reporting of broken stdout pipe during interpreter shutdown

2018-06-16 Thread Martin Panter
Martin Panter added the comment: Issue 33550 was opened about Mike’s case of ignoring broken pipe conditions. BTW a side effect of closing sys.stderr is that error messages reported by interpreter shutdown will be missing (even if there was no broken pipe). For example, exception messages

[issue11380] Improve reporting of broken stdout pipe during interpreter shutdown

2015-08-14 Thread Robert Collins
Robert Collins added the comment: Oh, just saw your comment Martin; yes, this does look like a dupe. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11380 ___

[issue11380] Improve reporting of broken stdout pipe during interpreter shutdown

2015-08-14 Thread Robert Collins
Robert Collins added the comment: Bah, wrong issue. Sorry. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11380 ___ ___ Python-bugs-list mailing

[issue11380] Improve reporting of broken stdout pipe during interpreter shutdown

2015-08-14 Thread Robert Collins
Robert Collins added the comment: @zzeeek For Python 3 pipeline tools you need something like this: try: all your stuff finally: try: sys.stdout.flush() finally: try: sys.stdout.close() finally: try: sys.stderr.flush()

[issue11380] Improve reporting of broken stdout pipe during interpreter shutdown

2015-08-14 Thread Robert Collins
Robert Collins added the comment: See also issue24864 which is not *quite* a dupe, I also found that it exits 0, unreasonably so. The reporting thing is interesting, but the main thing I care about is that we can catch it and do something reasonable with it... and that if not caught it

[issue11380] Improve reporting of broken stdout pipe during interpreter shutdown

2014-05-05 Thread Christopher Heiny
Changes by Christopher Heiny christopherhe...@gmail.com: -- nosy: +Christopher.Heiny ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11380 ___ ___

[issue11380] Improve reporting of broken stdout pipe during interpreter shutdown

2014-04-18 Thread Florent Xicluna
Changes by Florent Xicluna florent.xicl...@gmail.com: -- nosy: +flox ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11380 ___ ___ Python-bugs-list

[issue11380] Improve reporting of broken stdout pipe during interpreter shutdown

2014-03-21 Thread Dillon Aumiller
Changes by Dillon Aumiller dillonaumil...@gmail.com: -- nosy: +daumiller ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11380 ___ ___

[issue11380] Improve reporting of broken stdout pipe during interpreter shutdown

2014-03-10 Thread mike bayer
mike bayer added the comment: my users are reporting one of these issues, and while I can easily catch IOError on Python 2, I can't catch anything on Python 3, and pointing SIGPIPE to SIG_DFL isn't an option because this is for Alembic migrations and the command needs to complete its work.

[issue11380] Improve reporting of broken stdout pipe during interpreter shutdown

2013-09-23 Thread Nick Coghlan
Nick Coghlan added the comment: It seems this can be triggered easily with echo, since that appears to reliably close stdin on startup (Discovered via http://stackoverflow.com/questions/16314321). Compare (using a recent trunk build, although I see the same behaviour with the system 3.3

[issue11380] Improve reporting of broken stdout pipe during interpreter shutdown

2013-09-23 Thread Antoine Pitrou
Antoine Pitrou added the comment: I'm not sure I understand Nick's suggestion. As far as I can tell, the issue is to detect that write() (really fwrite() in 2.x) failed and output the error. -- ___ Python tracker rep...@bugs.python.org

[issue11380] Improve reporting of broken stdout pipe during interpreter shutdown

2013-09-23 Thread Antoine Pitrou
Antoine Pitrou added the comment: Ah, actually, the real issue is that sys.stderr is gone by the time we try to print the exception (which explains the lost sys.stderr message). -- ___ Python tracker rep...@bugs.python.org

[issue11380] Improve reporting of broken stdout pipe during interpreter shutdown

2013-09-23 Thread Antoine Pitrou
Antoine Pitrou added the comment: Here is a patch, lacking tests. How important it is to fix this in 2.7 I'm not sure. People are certainly used to the quirk now, and it's generally harmless. -- keywords: +patch Added file:

[issue11380] Improve reporting of broken stdout pipe during interpreter shutdown

2013-09-23 Thread Nick Coghlan
Nick Coghlan added the comment: My specific suggestion was aimed at 3.4 - I think reporting the failure to flush stdout on stderr is the right thing to do (since data may have been lost and people can suppress it by closing stdout early, including in an atexit handler), but I also think it's

[issue11380] Improve reporting of broken stdout pipe during interpreter shutdown

2013-09-23 Thread Antoine Pitrou
Antoine Pitrou added the comment: My specific suggestion was aimed at 3.4 - I think reporting the failure to flush stdout on stderr is the right thing to do (since data may have been lost and people can suppress it by closing stdout early, including in an atexit handler), but I also think

[issue11380] Improve reporting of broken stdout pipe during interpreter shutdown

2013-09-23 Thread Nick Coghlan
Nick Coghlan added the comment: Suppress the traceback, avoid printing the exception repr and instead display something more like Broken pipe: receiving end of stdout closed prior to interpreter shutdown -- ___ Python tracker rep...@bugs.python.org