From 2c61b5048f2b455fbfe92b3096a866e8f2c0982e Mon Sep 17 00:00:00 2001 From: Kartikaya Gupta Date: Wed, 6 May 2020 16:08:58 +0000 Subject: [PATCH] Bug 1635809 - Prevent crash in converter.py on debug output with non-ascii hg log data. r=kvark This is just in debug output, so the fact that we ignore non-utf-8 chars is ok. Depends on D74064 Differential Revision: https://phabricator.services.mozilla.com/D74065 --- tools/github-sync/converter.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/github-sync/converter.py b/tools/github-sync/converter.py index 68d21850ca7e..35e6a369a895 100755 --- a/tools/github-sync/converter.py +++ b/tools/github-sync/converter.py @@ -398,7 +398,7 @@ if DEBUG: '-r', 'descendants(' + base_hg_rev + ')', '--template', '{node} {desc|firstline}\\n']) for line in output.splitlines(): - eprint(str(line, "ascii")) + eprint(line.decode('utf-8', 'ignore')) # Also flag any changes that touch the project query = '(' + wider_range + ') & modifies("glob:' + relative_path + '/**")'