This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients Arfrever, amaury.forgeotdarc, denilsonsa, eric.araujo, giampaolo.rodola, loewis, neologix, pitrou, python-dev, rosslagerwall, techtonik, vstinner, zbysz
Date 2012-02-12.23:45:10
SpamBayes Score 1.7871923e-08
Marked as misclassified No
Message-id <1329090311.11.0.743991113314.issue13609@psf.upfronthosting.co.za>
In-reply-to
Content
> E.g. almost all programs disable color when piped explicitly through less.

Using my patch, you can use os.get_terminal_size(sys.stdout.fileno()) if you like to get an error if sys.stdout is a pipe. My patch only changes the behaviour if no argument is specified (hum, the "special" behaviour should be documented). Or you can also check explicitly sys.stdout.isatty().

It is just more convinient to fallback to stdin if stdout is not a TTY.
History
Date User Action Args
2012-02-12 23:45:11vstinnersetrecipients: + vstinner, loewis, amaury.forgeotdarc, pitrou, techtonik, giampaolo.rodola, eric.araujo, Arfrever, zbysz, denilsonsa, neologix, rosslagerwall, python-dev
2012-02-12 23:45:11vstinnersetmessageid: <1329090311.11.0.743991113314.issue13609@psf.upfronthosting.co.za>
2012-02-12 23:45:10vstinnerlinkissue13609 messages
2012-02-12 23:45:10vstinnercreate