Patchwork [1,of,8] py3: cast bytes encoding name to str in fileset.py

login
register
mail settings
Submitter Yuya Nishihara
Date June 16, 2018, 11:06 a.m.
Message ID <5cb39a368c803683fd8b.1529147167@mimosa>
Download mbox | patch
Permalink /patch/32187/
State Accepted
Headers show

Comments

Yuya Nishihara - June 16, 2018, 11:06 a.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1529135798 -32400
#      Sat Jun 16 16:56:38 2018 +0900
# Node ID 5cb39a368c803683fd8bc944480486a618ab785a
# Parent  c924e7dbcd0ff8bf2f7ab9e5bde5f6679d70a894
py3: cast bytes encoding name to str in fileset.py

Patch

diff --git a/mercurial/fileset.py b/mercurial/fileset.py
--- a/mercurial/fileset.py
+++ b/mercurial/fileset.py
@@ -427,7 +427,7 @@  def encoding(mctx, x):
     for f in mctx.existing():
         d = mctx.ctx[f].data()
         try:
-            d.decode(enc)
+            d.decode(pycompat.sysstr(enc))
         except LookupError:
             raise error.Abort(_("unknown encoding '%s'") % enc)
         except UnicodeDecodeError: