line endings and Cygwin
Martin Pool
mbp at sourcefrog.net
Wed Apr 13 04:35:23 BST 2005
On Tue, 2005-04-12 at 10:46 +0200, Markus F.X.J. Oberhumer wrote:
> > As you see in the end of filename with id presents '\r' symbol. It is
> > strange, but `revision-history` file is created with line-endings
> > '\r\n'. Workaround for this very simple: we can open text file by
> > default with mode 'rU' (universal line-endings). I change default mode
> > in function `controlfile` of class `Branch` in this manner:
> >
> > def controlfile(self, file_or_path, mode='rU'):
>
> May I suggest that all files below .bzr should be opened in binary mode
> only - readlines() and friends under win32 handle this just fine, and
> this way it is easy to copy files around. This is also especially
> important if your repo is on a FAT mounted partion and gets accessed
> from multiple operating systems.
Just to be clear, do you mean that readlines() on Windows will do the
right thing on a file with only \n markers, even if it's opened in
binary mode?
I agree that everything under .bzr should be always UTF-8, unix-newlines
(except for stored file texts of course). That's not enforced properly
at the moment.
--
Martin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20050413/6c21c6f5/attachment.pgp
More information about the bazaar
mailing list