mercurial/encoding.py
changeset 45681 a736ab681b78
parent 44452 9d2b2df2c2ba
child 45942 89a2afe31e82
equal deleted inserted replaced
45680:bb1a988ef4a5 45681:a736ab681b78
   205             except UnicodeDecodeError:
   205             except UnicodeDecodeError:
   206                 u = s.decode("utf-8", "replace")  # last ditch
   206                 u = s.decode("utf-8", "replace")  # last ditch
   207                 # can't round-trip
   207                 # can't round-trip
   208                 return u.encode(_sysstr(encoding), "replace")
   208                 return u.encode(_sysstr(encoding), "replace")
   209     except LookupError as k:
   209     except LookupError as k:
   210         raise error.Abort(k, hint=b"please check your locale settings")
   210         raise error.Abort(
       
   211             pycompat.bytestr(k), hint=b"please check your locale settings"
       
   212         )
   211 
   213 
   212 
   214 
   213 def fromlocal(s):
   215 def fromlocal(s):
   214     # type: (bytes) -> bytes
   216     # type: (bytes) -> bytes
   215     """
   217     """