version-info --include-history UnicodeDecodeError (518609)
Eli Zaretskii
eliz at gnu.org
Fri Apr 9 09:12:00 BST 2010
> From: Eric Siegerman <lists08-bzr at davor.org>
> Date: Thu, 08 Apr 2010 22:49:11 -0400
>
> On Fri, 2010-04-09 at 09:00 +1000, Robert Collins wrote:
> > perhaps we could make the formatter 'know' that
> > it is writing to stdout[,] and error unless stdout is a pipe (and thus
> > presumably being redirected).
>
> A safer test would be (the python spelling of) isatty(3).
Are you sure it works reliably on MS-Windows? (I know almost nothing
about Python; perhaps it already has this issue solved. But
implementations of `isatty' in C libraries on Windows are notoriously
broken.)
> > That seems fragile though.
>
> On the other hand, there's precedent for it. "ls", "more"
> and "less" all vary their behaviour depending on whether
> stdout is a tty.
Only when they can reliably determine that. E.g., what do you want
them to do if stdout is a pipe? Some front ends run programs via a
pipe and expect them to behave like it were a tty (case in point:
Emacs as a GUI front end for GDB).
I'm not against the idea to behave differently, quite the contrary: I
think it's TRT. I'm just saying that implementing it might not be as
trivial as it sounds from the Posix-oriented perspective.
More information about the bazaar
mailing list