Patchwork [2,of,2,STABLE] py3: add inline comment about encoding issue of str(Abort())

login
register
mail settings
Submitter Yuya Nishihara
Date Nov. 5, 2019, 12:49 p.m.
Message ID <bcf32b32d7931a729c1c.1572958179@mimosa>
Download mbox | patch
Permalink /patch/42748/
State New
Headers show

Comments

Yuya Nishihara - Nov. 5, 2019, 12:49 p.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1572957319 -32400
#      Tue Nov 05 21:35:19 2019 +0900
# Branch stable
# Node ID bcf32b32d7931a729c1c12ad3aa67c93bff14e23
# Parent  ea5b708e3f51afe6591d7e595a7bcdd5e909cfc1
py3: add inline comment about encoding issue of str(Abort())

Patch

diff --git a/mercurial/error.py b/mercurial/error.py
--- a/mercurial/error.py
+++ b/mercurial/error.py
@@ -114,6 +114,9 @@  class Abort(Hint, Exception):
     if pycompat.ispy3:
 
         def __str__(self):
+            # the output would be unreadable if the message was translated,
+            # but do not replace it with encoding.strfromlocal(), which
+            # may raise another exception.
             return pycompat.sysstr(self.__bytes__())