From: John Keeping Date: Mon, 28 Jan 2013 11:20:43 GMT Subject: [PATCH] fixup! git-remote-testpy: fix path hashing on Python 3 Message-ID: <20130128112043.GZ7498@serenity.lan> In-Reply-To: <51065692.9000708@alum.mit.edu> --- On Mon, Jan 28, 2013 at 11:44:34AM +0100, Michael Haggerty wrote: > NAK. It is still not right. If the locale is not utf-8 based, then it > is incorrect to re-encode the string using utf-8. I think you really > have to use sys.getfilesystemencoding() as I suggested. If you'd asked me what the patch contained I would have said it did use getfilesystemencoding(), but I can't disbelieve my own eyes :-( Junio, please can you squash this in? git-remote-testpy.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/git-remote-testpy.py b/git-remote-testpy.py index 6098bdd..ca67899 100644 --- a/git-remote-testpy.py +++ b/git-remote-testpy.py @@ -49,7 +49,7 @@ def encode_filepath(path): """ if sys.hexversion < 0x03000000: return path - return path.encode('utf-8', 'surrogateescape') + return path.encode(sys.getfilesystemencoding(), 'surrogateescape') def get_repo(alias, url): -- 1.8.1.1