[BUNDLE] Make additional chance to obtain right encoding of console when output piped
John Arbash Meinel
john at arbash-meinel.com
Sun Jun 11 00:40:24 BST 2006
Aaron Bentley wrote:
> Robert Collins wrote:
>>>>> On Fri, Jun 09, 2006 at 07:57:49PM +0300, Alexander Belchenko wrote:
>>>>>
>>>>>> I wrote about this fact before: when output of bzr command piped to
>>>>>> another program, i.e. when run something like:
>>>>>>
>>>>>> bzr log | less
>>>>>>
>>>>>> Then sys.stdout lose their own encoding attribute value and bzr switch
>>>>>> to use bzrlib.user_encoding value. That behaviour on some system is
>>>>>> inappropriate, see bug 5041 as example.
>
> It's interesting to consider this behaviour in the context of the recent
> CRLF bug for bundles. (That is, Windows produces invalid bundles
> because its stdout is in text mode.)
>
> Presumably, the pipe behaviour is the same as the redirect behaviour.
> Which suggests that for bundles, we'd want to use utf-8 and force
> UNIX-style newlines when there was no stdout encoding.
>
> Aaron
Well, bundles would fall under the 'exact' style, same as 'diff'. So we
shouldn't automatically translate anything. And I suppose you have a
very valid argument that setting 'exact' should set O_BINARY on stdout.
John
=:->
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 254 bytes
Desc: OpenPGP digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060610/9a6898e7/attachment.pgp
More information about the bazaar
mailing list