[MERGE] Bugfix #55276: on win32 cat, bundle and diff commands provide binary output without mangling line-endings

Alexander Belchenko bialix at ukr.net
Sat Dec 16 10:28:18 GMT 2006


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Alexander Belchenko пишет:
> Aaron Bentley ?8H5B:
>> Alexander Belchenko wrote:
>>> Attached patch provide blackbox tests that illustrate problem
>>> and fix for cat, bundle and diff command.
>>> Fix made by providing new attribute of Command object: binary_stdout.
>>> When this attribute is True self.outf object forced to be binary
>>> stream instead of text one (by default). Because some tests
>>> use StringIO file-like object instead of real sys.stdout
>>> so I need to explicitly check for presence of fileno attribute.
>> It seems like exact should imply binary_stdout.  At least, my
>> understanding was that 'exact' means you're writing bytes, not
>> characters, to self.outf.  So you wouldn't actually need a binary_stdout
>> flag.
> 
>> Can anyone think of a counterexample, or point out a flaw in my
>> understanding?
> 
> Actually only diff command has encoding_type = 'exact',
> both cat and bundle commands use 'strict'.

After inspecting attributes of all built-ins non-hidden command
I see that only 2 commands have exact encoding type: diff and version-info.

I don't think that parsing output of version-info will be difficult
with CRLF line-endings, so I think this command don't require binary
stdout on win32.

Alexander
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFg8pCzYr338mxwCURAoHkAJ0YcHlkI1W0EVsDfE94vGooyK8K+gCfdgZz
vow5t+SHqJxCR+8YikEsK+Q=
=46xS
-----END PGP SIGNATURE-----





More information about the bazaar mailing list