encoding.py bug?

Cesar Mena cesar.mena at gmail.com
Sun Apr 22 19:48:57 UTC 2012


hi,

in encoding.py, stable branch, up to date, shouldn't the first attempt at
encoding catch UnicodeEncodeError, as opposed to UnicodeDecodeError?

ie,

diff --git a/mercurial/encoding.py b/mercurial/encoding.py
--- a/mercurial/encoding.py
+++ b/mercurial/encoding.py
@@ -169,7 +169,7 @@
     "best-effort encoding-aware case-folding of local string s"
     try:
         return s.encode('ascii').lower()
-    except UnicodeDecodeError:
+    except UnicodeEncodeError:
         pass
     try:
         if isinstance(s, localstr):

cheers,
-cm
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurial-scm.org/pipermail/mercurial/attachments/20120422/aa53ed2e/attachment-0002.html>


More information about the Mercurial mailing list