Patchwork D9868: run-test: avoid byte issue when replacing output file of python test

login
register
mail settings
Submitter phabricator
Date Jan. 26, 2021, 2:37 a.m.
Message ID <differential-rev-PHID-DREV-5vc35eek7swk34ufkcwa-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/48182/
State Superseded
Headers show

Comments

phabricator - Jan. 26, 2021, 2:37 a.m.
marmoute created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  Otherwise we get error like::
  
    FileNotFoundError: [Errno 2] No such file or directory: "b'…/tests/test-minirst.py'.out"

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  tests/run-tests.py

CHANGE DETAILS




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

Patch

diff --git a/tests/run-tests.py b/tests/run-tests.py
--- a/tests/run-tests.py
+++ b/tests/run-tests.py
@@ -2278,7 +2278,7 @@ 
                         if test.path.endswith(b'.t'):
                             rename(test.errpath, test.path)
                         else:
-                            rename(test.errpath, '%s.out' % test.path)
+                            rename(test.errpath, b'%s.out' % test.path)
                         accepted = True
             if not accepted:
                 self.faildata[test.name] = b''.join(lines)