Mercurial > hg
changeset 41517:549f956ba2a9
py3: don't use universal_newlines in svnsubrepo
On Python 3, it means text=True without any specific encoding, which is
pretty bad. Instead, use util.fromnativeeol() to translate CR+LF to LF
without encoding conversion.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sat, 02 Feb 2019 15:26:51 +0900 |
parents | d65519e5dd04 |
children | 530d211ae9a8 |
files | mercurial/subrepo.py |
diffstat | 1 files changed, 1 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/subrepo.py Sat Feb 02 15:21:35 2019 +0900 +++ b/mercurial/subrepo.py Sat Feb 02 15:26:51 2019 +0900 @@ -958,10 +958,8 @@ p = subprocess.Popen(pycompat.rapply(procutil.tonativestr, cmd), bufsize=-1, close_fds=procutil.closefds, stdout=subprocess.PIPE, stderr=subprocess.PIPE, - universal_newlines=True, env=procutil.tonativeenv(env), **extrakw) - stdout, stderr = p.communicate() - stdout, stderr = pycompat.fsencode(stdout), pycompat.fsencode(stderr) + stdout, stderr = map(util.fromnativeeol, p.communicate()) stderr = stderr.strip() if not failok: if p.returncode: