diff --git a/hgext/convert/common.py b/hgext/convert/common.py --- a/hgext/convert/common.py +++ b/hgext/convert/common.py @@ -339,7 +339,7 @@ class commandline(object): pass cmdline = [util.shellquote(arg) for arg in cmdline] if not self.ui.debugflag: - cmdline += ['2>', os.devnull] + cmdline += ['2>', pycompat.bytestr(os.devnull)] cmdline = ' '.join(cmdline) return cmdline diff --git a/mercurial/windows.py b/mercurial/windows.py --- a/mercurial/windows.py +++ b/mercurial/windows.py @@ -316,7 +316,7 @@ def popen(command, mode='r'): # Work around "popen spawned process may not write to stdout # under windows" # http://bugs.python.org/issue1366 - command += " 2> %s" % os.devnull + command += " 2> %s" % pycompat.bytestr(os.devnull) return os.popen(quotecommand(command), mode) def explainexit(code):