Patchwork [3,of,3,STABLE] py3: encode strings before setting rev summary in gnuarch converter

login
register
mail settings
Submitter Denis Laxalde
Date Nov. 4, 2019, 9:18 a.m.
Message ID <b760c0afe8e8cc864b06.1572859126@marimba>
Download mbox | patch
Permalink /patch/42707/
State Accepted
Headers show

Comments

Denis Laxalde - Nov. 4, 2019, 9:18 a.m.
# HG changeset patch
# User Denis Laxalde <denis@laxalde.org>
# Date 1572858548 -3600
#      Mon Nov 04 10:09:08 2019 +0100
# Branch stable
# Node ID b760c0afe8e8cc864b069b4f56d6548e004131d2
# Parent  e0e912bb2453e033807000be5a5c648efef72d59
py3: encode strings before setting rev summary in gnuarch converter

---
This makes test-convert-tla.t pass on Python 3.7.

Patch

diff --git a/hgext/convert/gnuarch.py b/hgext/convert/gnuarch.py
--- a/hgext/convert/gnuarch.py
+++ b/hgext/convert/gnuarch.py
@@ -310,7 +310,10 @@  class gnuarch_source(common.converter_so
 
             # Commit description
             self.changes[rev].summary = b'\n\n'.join(
-                (catlog[r'Summary'], catlog.get_payload())
+                (
+                    self.recode(catlog[r'Summary']),
+                    self.recode(catlog.get_payload()),
+                )
             )
             self.changes[rev].summary = self.recode(self.changes[rev].summary)