Patchwork D2477: py3: convert os.devnull to bytes using pycompat.bytestr

login
register
mail settings
Submitter phabricator
Date Feb. 27, 2018, 12:57 p.m.
Message ID <7ededbff9c3a4d59f582bacade1148a5@localhost.localdomain>
Download mbox | patch
Permalink /patch/28456/
State Not Applicable
Headers show

Comments

phabricator - Feb. 27, 2018, 12:57 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG0e8b76644e20: py3: convert os.devnull to bytes using pycompat.bytestr (authored by pulkit, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D2477?vs=6157&id=6172

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

AFFECTED FILES
  hgext/convert/common.py
  mercurial/windows.py

CHANGE DETAILS




To: pulkit, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/mercurial/windows.py b/mercurial/windows.py
--- a/mercurial/windows.py
+++ b/mercurial/windows.py
@@ -316,7 +316,7 @@ 
     # 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):
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 @@ 
                 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