Patchwork [1,of,2] py3: remove unneeded fsencode() from gitsubrepo

login
register
mail settings
Submitter Yuya Nishihara
Date Feb. 2, 2019, 6:38 a.m.
Message ID <921b4ffa9ced910ea79c.1549089532@mimosa>
Download mbox | patch
Permalink /patch/38324/
State Accepted
Headers show

Comments

Yuya Nishihara - Feb. 2, 2019, 6:38 a.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1549088495 -32400
#      Sat Feb 02 15:21:35 2019 +0900
# Node ID 921b4ffa9ced910ea79cb839b86a06287710f29c
# Parent  3a3b053d0882a33ba7ea667052e445b193ffa4df
py3: remove unneeded fsencode() from gitsubrepo

Here p.stdout isn't a TextIO. read() must return bytes.
Pulkit Goyal - Feb. 2, 2019, 3:27 p.m.
On Sat, Feb 2, 2019 at 12:12 PM Yuya Nishihara <yuya@tcha.org> wrote:

> # HG changeset patch
> # User Yuya Nishihara <yuya@tcha.org>
> # Date 1549088495 -32400
> #      Sat Feb 02 15:21:35 2019 +0900
> # Node ID 921b4ffa9ced910ea79cb839b86a06287710f29c
> # Parent  3a3b053d0882a33ba7ea667052e445b193ffa4df
> py3: remove unneeded fsencode() from gitsubrepo
>
> Here p.stdout isn't a TextIO. read() must return bytes.
>

Queued the series, may thanks!

Patch

diff --git a/mercurial/subrepo.py b/mercurial/subrepo.py
--- a/mercurial/subrepo.py
+++ b/mercurial/subrepo.py
@@ -1286,7 +1286,7 @@  class gitsubrepo(abstractsubrepo):
         if stream:
             return p.stdout, None
 
-        retdata = pycompat.fsencode(p.stdout.read().strip())
+        retdata = p.stdout.read().strip()
         # wait for the child to exit to avoid race condition.
         p.wait()