Jani Averbach <jaa@jaa.iki.fi> writes:
> > This was a bit surprising to me... Why wouldn't one open a text base
> > file as binary in every case? What bad effect was it having?
>
> I have the 'to be expected' keyword strings and keyword stubs written
> as: '$URL:: ..... \n' and python writes them to the disk with "\r\n"
> line endings on Windows. If I read those strings back to python on
> text mode, the line ends are exactly '\n' (which will match my test
> strings). If I read them as binary (rb), the string will contain
> "\r\n" which won't match with '\n' (extra '\r'). The
> fixed_keyword_test file doesn't use svn:eol-style=native, so the text
> base is indeed in '\r\n' mode.
>
> It is fun, isn't it?
Eeuww, yes :-).
So it would be better if could have the strings in the source code
contain the correct line endings, the ones that will be written to out
the text-bases, so that reading the text-base in binary mode results
in the correct strings... But I'm not sure how to do that. In any
case, at least a comment near the open() call would be good, to
explain things to a confused reader.
-K
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Mon Nov 8 19:10:43 2004