Patchwork D3588: pathencode: hashlib.sha1() takes bytes not str on Python 3

login
register
mail settings
Submitter phabricator
Date May 19, 2018, 2:37 a.m.
Message ID <540ed18a9460a81b100d7105fec8b579@localhost.localdomain>
Download mbox | patch
Permalink /patch/31675/
State Not Applicable
Headers show

Comments

phabricator - May 19, 2018, 2:37 a.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG4fccc73ce2f6: pathencode: hashlib.sha1() takes bytes not str on Python 3 (authored by durin42, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D3588?vs=8750&id=8759

REVISION DETAIL
  https://phab.mercurial-scm.org/D3588

AFFECTED FILES
  mercurial/cext/pathencode.c

CHANGE DETAILS




To: durin42, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/mercurial/cext/pathencode.c b/mercurial/cext/pathencode.c
--- a/mercurial/cext/pathencode.c
+++ b/mercurial/cext/pathencode.c
@@ -678,7 +678,7 @@ 
 		}
 	}
 
-	shaobj = PyObject_CallFunction(shafunc, "s#", str, len);
+	shaobj = PyObject_CallFunction(shafunc, PY23("s#", "y#"), str, len);
 
 	if (shaobj == NULL)
 		return -1;