From patchwork Tue Jan 26 02:37:06 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: D9868: run-test: avoid byte issue when replacing output file of python test From: phabricator X-Patchwork-Id: 48182 Message-Id: To: Phabricator Cc: mercurial-devel@mercurial-scm.org Date: Tue, 26 Jan 2021 02:37:06 +0000 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 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)