[PATCH 2 of 3] py3: utility functions to convert keys of kwargs to bytes/unicodes

Yuya Nishihara yuya at tcha.org
Sun Dec 11 08:36:13 EST 2016


On Sat, 10 Dec 2016 05:10:26 +0530, Pulkit Goyal wrote:
> # HG changeset patch
> # User Pulkit Goyal <7895pulkit at gmail.com>
> # Date 1481127783 -19800
> #      Wed Dec 07 21:53:03 2016 +0530
> # Node ID 7fcea54acba98b7f1d994bd7311bb0f5ec566b65
> # Parent  4b57889d58056f95c58f2379836437a65950424c
> py3: utility functions to convert keys of kwargs to bytes/unicodes

Queued this, too.

> --- a/mercurial/pycompat.py	Tue Dec 06 06:36:36 2016 +0530
> +++ b/mercurial/pycompat.py	Wed Dec 07 21:53:03 2016 +0530
> @@ -101,6 +101,20 @@
>          args = [a.encode('latin-1') for a in args]
>          return opts, args
>  
> +    # keys of keyword arguments in Python need to be strings which are unicodes
> +    # Python 3. This function take keyword arguments, convert the keys to str
> +    # if they are in bytes.

Removed "if they are in bytes."


More information about the Mercurial-devel mailing list