yuja added inline comments.

INLINE COMMENTS

> pycompat.py:84
> +                    setattr(sys, stream, noclosetextio(s))
> +            return bytestr(input(*args, **kwargs))
> +        finally:

Needs to specify encoding because user input may contain
non-ascii characters.

Perhaps it should be `noclosetextio(s, encoding=encoding.encoding)` and
`encoding.strtolocal(input(...))`.
Alternatively, forcing `latin-1` might work, but I'm not sure.

> ui.py:1222
>          with self.timeblockedsection('stdio'):
> -            line = raw_input(' ')
> +            line = pycompat.bytesinput(r' ')
>          sys.stdin = oldin

I think it's better to specify input and output explicitly.

`bytesinput(..., self.fin, self.fout)`

Setting BytesIO to `sys.stdin/stdout` is just plain wrong on Python 3.

REPOSITORY
  rHG Mercurial

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

To: durin42, #hg-reviewers
Cc: yuja, mercurial-devel
_______________________________________________
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

Reply via email to