Patchwork D3489: cvsps: convert encoding name to sysstr

login
register
mail settings
Submitter phabricator
Date May 8, 2018, 1:37 p.m.
Message ID <differential-rev-PHID-DREV-f67w5rmhy5sgllshjslp-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/31367/
State Superseded
Headers show

Comments

phabricator - May 8, 2018, 1:37 p.m.
durin42 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D3489

AFFECTED FILES
  hgext/convert/cvsps.py

CHANGE DETAILS




To: durin42, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/hgext/convert/cvsps.py b/hgext/convert/cvsps.py
--- a/hgext/convert/cvsps.py
+++ b/hgext/convert/cvsps.py
@@ -510,7 +510,8 @@ 
             comment = entry.comment
             for e in encodings:
                 try:
-                    entry.comment = comment.decode(e).encode('utf-8')
+                    entry.comment = comment.decode(
+                        pycompat.sysstr(e)).encode('utf-8')
                     if ui.debugflag:
                         ui.debug("transcoding by %s: %s of %s\n" %
                                  (e, revstr(entry.revision), entry.file))