Patchwork D8469: setup: use sysstr() on process output

login
register
mail settings
Submitter phabricator
Date April 22, 2020, 2:39 a.m.
Message ID <differential-rev-PHID-DREV-su4l5ztn3l2yiybsi7a6-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/46202/
State Superseded
Headers show

Comments

phabricator - April 22, 2020, 2:39 a.m.
indygreg created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  Otherwise we get a str-bytes mismatch on Python 3 if
  an error occurs.

REPOSITORY
  rHG Mercurial

BRANCH
  stable

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

AFFECTED FILES
  setup.py

CHANGE DETAILS




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

Patch

diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -890,7 +890,8 @@ 
             )
             if res:
                 raise SystemExit(
-                    'error running gendoc.py: %s' % '\n'.join([out, err])
+                    'error running gendoc.py: %s'
+                    % '\n'.join([sysstr(out), sysstr(err)])
                 )
 
             with open(txt, 'wb') as fh:
@@ -907,7 +908,8 @@ 
             )
             if res:
                 raise SystemExit(
-                    'error running gendoc: %s' % '\n'.join([out, err])
+                    'error running gendoc: %s'
+                    % '\n'.join([sysstr(out), sysstr(err)])
                 )
 
             with open(gendoc, 'wb') as fh:
@@ -932,7 +934,8 @@ 
             )
             if res:
                 raise SystemExit(
-                    'error running runrst: %s' % '\n'.join([out, err])
+                    'error running runrst: %s'
+                    % '\n'.join([sysstr(out), sysstr(err)])
                 )
 
             normalizecrlf('doc/%s' % root)
@@ -957,7 +960,8 @@ 
             )
             if res:
                 raise SystemExit(
-                    'error running runrst: %s' % '\n'.join([out, err])
+                    'error running runrst: %s'
+                    % '\n'.join([sysstr(out), sysstr(err)])
                 )
 
             normalizecrlf('doc/%s.html' % root)