[PATCH 1 of 2] py3: open file in rb mode
Yuya Nishihara
yuya at tcha.org
Wed Mar 15 09:05:01 EDT 2017
On Wed, 15 Mar 2017 15:05:10 +0530, Rishabh Madan wrote:
> # HG changeset patch
> # User Rishabh Madan <rishabhmadan96 at gmail.com>
> # Date 1489569678 -19800
> # Wed Mar 15 14:51:18 2017 +0530
> # Node ID 1ada79790380d3f9e416780f6447b383cc18f817
> # Parent 1c48a8278b2f015fca607dfc652823560a5ac580
> py3: open file in rb mode
>
> diff -r 1c48a8278b2f -r 1ada79790380 mercurial/match.py
> --- a/mercurial/match.py Sun Mar 12 17:16:43 2017 -0700
> +++ b/mercurial/match.py Wed Mar 15 14:51:18 2017 +0530
> @@ -740,7 +740,7 @@
> syntax = 'relre:'
> patterns = []
>
> - fp = open(filepath)
> + fp = open(filepath, 'rb')
> for lineno, line in enumerate(util.iterfile(fp), start=1):
> if "#" in line:
> global _commentre
Since we do line.rstrip(), this should be fine. Queued the first patch,
thanks.
More information about the Mercurial-devel
mailing list