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

Yuya Nishihara yuya at tcha.org
Tue Nov 5 07:49:39 EST 2019


# HG changeset patch
# User Yuya Nishihara <yuya at 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())

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__())
 
 


More information about the Mercurial-devel mailing list