Yup. On POSIX platforms, for example, Python will simply ignore the 'b' part
of the mode string.
Cheers,
-g
On Tue, Feb 25, 2003 at 05:40:44PM -0800, Dale Hirt wrote:
> And that will work for both text and binary files on both platforms?
>
> -----Original Message-----
> From: Greg Stein [mailto:gstein@lyra.org]
> Sent: Tuesday, February 25, 2003 5:33 PM
> To: Dale Hirt
> Cc: dev@subversion.tigris.org
> Subject: Re: rcsparse.py
>
>
> On Tue, Feb 25, 2003 at 02:31:08PM -0800, Dale Hirt wrote:
> > So,
> >
> > I finally manage to get everything compiled and working, and what happens?
> > Rcsparse.py chokes on the first binary cvs file it finds. Ugh. Any
> ideas?
> > The stack trace follows for your fun and amusement.
> >...
> > File "D:\work\subversion\tools\cvs2svn\cvs2svn.py", line 232, in
> visit_file
> > p.parse(open(pathname), cd)
>
> Here is the problem. We aren't opening the file in binary mode, so it
> defaults to text mode, which does newline translation. That is going to
> break things pretty quick.
>
> It happens to work on Unix boxes because there is no difference between text
> and binary modes.
>
> The line should read:
>
> p.parse(open(pathname, 'rb'), cd)
>
> Cheers,
> -g
>
> --
> Greg Stein, http://www.lyra.org/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: dev-help@subversion.tigris.org
--
Greg Stein, http://www.lyra.org/
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Wed Feb 26 03:18:52 2003