[PATCH bfiles] use binary mode to read/write files from an httpstore

Benjamin Pollack benjamin at bitquabit.com
Wed Jun 9 09:48:28 CDT 2010


On Jun 9, 2010, at 10:28 AM, Benjamin Pollack wrote:

> # HG changeset patch
> # User Benjamin Pollack <benjamin at bitquabit.com>
> # Date 1276093276 14400
> # Node ID ea79376a44f1472a1aeebed6a3b60ae3daa37dd2
> # Parent  9e2d44a8c987f3868e61bae715467c55c4f0cb85
> use binary mode to read/write files from an httpstore
> 
> diff --git a/bfiles.py b/bfiles.py
> --- a/bfiles.py
> +++ b/bfiles.py
> @@ -1437,7 +1437,7 @@
>         elif r:
>             # error message from remote
>             self.abort(error.RepoError(_("put failed: %s") % r))
> -        fd = open(filename)
> +        fd = open(filename, 'rb')
>         while 1:
>             d = fd.read(4096)
>             if not d:

Note that an identical bug existed in the bfiles-httpstore patches that were submitted earlier, so I fixed that patch queue. You can grab the updated version at http://bitbucket.org/bpollack/bfiles-httpstore.

--Benjamin


More information about the Mercurial-devel mailing list