Patchwork D10203: crecord: convert an instance of bytes to str

login
register
mail settings
Submitter phabricator
Date March 13, 2021, 7:33 p.m.
Message ID <differential-rev-PHID-DREV-xf3nifuvzxdkq4qwafai-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/48519/
State Superseded
Headers show

Comments

phabricator - March 13, 2021, 7:33 p.m.
mharbison72 created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  Caught by pytype:
  
    File "/mnt/c/Users/Matt/hg/mercurial/crecord.py", line 1154, in printstring: Function _CursesWindow.addstr was called with the wrong arguments [wrong-arg-types]
             Expected: (self, str: str, ...)
      Actually passed: (self, str: bytes, ...)

REPOSITORY
  rHG Mercurial

BRANCH
  stable

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

AFFECTED FILES
  mercurial/crecord.py

CHANGE DETAILS




To: mharbison72, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/mercurial/crecord.py b/mercurial/crecord.py
--- a/mercurial/crecord.py
+++ b/mercurial/crecord.py
@@ -1152,7 +1152,7 @@ 
             numtrailingspaces = origlen - strippedlen
 
         if towin:
-            window.addstr(text, colorpair)
+            window.addstr(encoding.strfromlocal(text), colorpair)
         t += text
 
         if showwhtspc: