testbzr fails on windows with bad line endings.
John A Meinel
john at arbash-meinel.com
Wed May 25 00:21:47 BST 2005
What does the 't' stand for for opening files in 'wt' mode? After
looking and looking, and browsing through the python source. I think I
found that it means absolutely nothing to python. It seems to pass it on
to the fopen() command, but even with that, I can't find a definition
for it.
Anyway, whatever the meaning, 'bzr ignore' opens the .bzrignore file in
'wt' mode, but testbzr opens it in 'rb' mode. Which means that 'bzr
ignore' creates dos line endings (CRLF) but testbzr expects unix endings
(LF).
What is the 'correct' file format? Should control files always be
read-opened in Universal mode as described here:
http://www.python.org/peps/pep-0278.html
My vote is to have control files opened in 'rU' for reading, and either
plain 'w', or 'wb' for writing. I prefer seeing 'wb' for everything,
since that means if I am doing work on windows, and then I rsync to a
linux machine, things work properly line endings don't do funny things.
'rU' is just so that if someone edits something on windows in a foolish
text editor, then things don't get borked.
I thought that is what I've seen on this list, and if that is the case,
I can do a run through and create a patch which changes all 'wt' with 'wb'.
John
=:->
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 253 bytes
Desc: OpenPGP digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20050524/8b5404e1/attachment.pgp
More information about the bazaar
mailing list