D886: ui: convert to/from Optional[bytes] to Optional[str] in password manager

yuja (Yuya Nishihara) phabricator at mercurial-scm.org
Mon Oct 2 05:38:11 EDT 2017


yuja requested changes to this revision.
yuja added inline comments.
This revision now requires changes to proceed.

INLINE COMMENTS

> ui.py:141
> +        return None
> +    if pycompat.ispy3:
> +        return pycompat.strurl(maybebytes)

Nit: no need to check if ispy3.

> ui.py:169
> +            _maybestrurl(realm), uris,
> +            _maybestrurl(user), _maybestrurl(passwd))
>  

No idea how user and passwd are encoded, but encoding.strfromlocal() might
be better because strurl() can raise unicode exception if non-ascii string is passed.

REPOSITORY
  rHG Mercurial

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

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


More information about the Mercurial-devel mailing list