[issue19212] Invitation to connect on LinkedIn
New submission from Caitlin Potter: LinkedIn Python, I'd like to add you to my professional network on LinkedIn. - Caitlin Caitlin Potter Freelance Developer at freelance software developer "self employed" Toronto, Canada Area Confirm that you know Caitlin Potter: https://www.linkedin.com/e/-3qcne3-hml1zaap-1f/isd/17195171015/l2fhHe9j/?hs=false&tok=2MQlcG4YvniRY1 -- You are receiving Invitation to Connect emails. Click to unsubscribe: http://www.linkedin.com/e/-3qcne3-hml1zaap-1f/z2oU7dKDzpt2G7xQz2FC2SclHmnUGzmsk0c/goo/report%40bugs%2Epython%2Eorg/20061/I5707467440_1/?hs=false&tok=1rzhxcavbniRY1 (c) 2012 LinkedIn Corporation. 2029 Stierlin Ct, Mountain View, CA 94043, USA. -- messages: 199343 nosy: Caitlin.Potter priority: normal severity: normal status: open title: Invitation to connect on LinkedIn ___ Python tracker <http://bugs.python.org/issue19212> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue17647] subprocess.communicate() should preserve colored output on Windows
New submission from Caitlin Potter: In migrating from GNU autoconf/automake build systems to a python-based build system (Waf), I've been slightly annoyed that coloured text output from unit test programs is lost on the windows platform (the gtest framework uses ::SetConsoleTextAttribute on windows) Ideally, the coloured output from the test sets would be preserved so that problems could be easily identified and stand out (See attached image for demonstration of problem) This might be scoffed at as a minor problem because nobody uses SetConsoleTextAttribute anyways, and even if they do it would only affect the windows platform. But just the same, preserving coloured output on windows should be doable. I'd be happy to work on a patch for this myself, but I'm new to the python tree and am not completely sure where to find what I'm looking for. I think an if mswindows: clause wherever stdout.read() is would probably work, but I'm not sure where that would be. -- components: IO, Windows files: unit-tests.png messages: 186168 nosy: Caitlin.Potter priority: normal severity: normal status: open title: subprocess.communicate() should preserve colored output on Windows type: behavior versions: Python 2.7 Added file: http://bugs.python.org/file29699/unit-tests.png ___ Python tracker <http://bugs.python.org/issue17647> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue17647] subprocess.communicate() should preserve colored output on Windows
Caitlin Potter added the comment: I'm not entirely positive that it would be doable, but looking at the subprocess code, it looks like we do have an open handle to the windows stdout buffer, including buffer attributes, so it should be possible to translate coloured attributes into ANSI codes, Whether this would or would not break anything else is a different story, of course. Obviously there are times where you wouldn't want ANSI color codes in the output, and I'm not sure how you could differentiate between a pipe to a terminal buffer, or a pipe to a file. Somewhat relevant, but perhaps not so much: The google test framework does actually test isatty() before using ANSI escape characters, however I've tested this same test program in a development environment, with colours preserved, which was a bit curious (the test I've put together is available at http://github.com/caitp/waftest, however it will break on a lot of systems, depending on the way pthread needs to be used) On Sun, Apr 7, 2013 at 2:39 PM, Richard Oudkerk wrote: > > Richard Oudkerk added the comment: > > On 07/04/2013 7:21pm, R. David Murray wrote: > > Certainly on unix if you write ANSI color codes to stdout and the reader > > doesn't strip them, they will be preserved and can be redisplayed, so > > being able to do something similar on Windows would be nice. > > Although sensible unix programs capable of producing coloured text > refuse to do so (by default) if output is a pipe rather than a tty. > > -- > > ___ > Python tracker > <http://bugs.python.org/issue17647> > ___ > -- ___ Python tracker <http://bugs.python.org/issue17647> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue17647] subprocess.communicate() should preserve colored output on Windows
Caitlin Potter added the comment: > however I've tested this same test program in a > development environment, *unix* development environment (xterm, ubuntu 12.04), rather. -- ___ Python tracker <http://bugs.python.org/issue17647> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue17647] subprocess.communicate() should preserve colored output on Windows
Caitlin Potter added the comment: Then perhaps nothing can be done from the python side of things, that's too bad. On Sun, Apr 7, 2013 at 4:38 PM, Richard Oudkerk wrote: > > Richard Oudkerk added the comment: > > On 07/04/2013 9:02pm, Caitlin Potter wrote: > > I'm not entirely positive that it would be doable, but looking at the > > subprocess code, it looks like we do have an open handle to the windows > > stdout buffer, including buffer attributes, so it should be possible to > > translate coloured attributes into ANSI codes, > > The handle for stdout is just the readable end of a pipe. It is not a > console, GetConsoleScreenBufferInfo() will not work with it, and there > are no coloured attributes associated with it. > > -- > > ___ > Python tracker > <http://bugs.python.org/issue17647> > ___ > -- ___ Python tracker <http://bugs.python.org/issue17647> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue17647] subprocess.communicate() should preserve colored output on Windows
Caitlin Potter added the comment: A suggestion to work around this from #waf on freenode: http://codepad.org/1Y8K9e2m So it is probably not a big deal and can be wrapped up. But still it would be nice if Windows had native support for ANSI colours. On Fri, Apr 12, 2013 at 2:08 PM, Terry J. Reedy wrote: > > Terry J. Reedy added the comment: > > We seem to agree that this is an OS+application issue, not a Python issue. > > I think the red FAILEDs would be nice for unittest (a possible separate > issue). > > -- > nosy: +terry.reedy > resolution: -> invalid > status: open -> closed > > ___ > Python tracker > <http://bugs.python.org/issue17647> > ___ > -- ___ Python tracker <http://bugs.python.org/issue17647> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue17647] subprocess.communicate() should preserve colored output on Windows
Caitlin Potter added the comment: Sorry Terry, gmail hides it by default, didn't notice. -- ___ Python tracker <http://bugs.python.org/issue17647> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com