Mercurial > hg > mercurial-source
comparison hgext/convert/darcs.py @ 5488:003d1f174fe1
Fix Windows os.popen bug with interleaved stdout/stderr output
See python bug 1366 "popen spawned process may not write to stdout under windows" for more details.
author | Patrick Mezard <pmezard@gmail.com> |
---|---|
date | Thu, 01 Nov 2007 12:05:14 +0100 |
parents | fbf40ad5a8c2 |
children | 4d38e6970b8c cc3af86ab6fe |
comparison
equal
deleted
inserted
replaced
5487:81bef3c355c5 | 5488:003d1f174fe1 |
---|---|
63 def _run(self, cmd, *args, **kwargs): | 63 def _run(self, cmd, *args, **kwargs): |
64 cmdline = ['darcs', cmd, '--repodir', kwargs.get('repodir', self.path)] | 64 cmdline = ['darcs', cmd, '--repodir', kwargs.get('repodir', self.path)] |
65 cmdline += args | 65 cmdline += args |
66 cmdline = [util.shellquote(arg) for arg in cmdline] | 66 cmdline = [util.shellquote(arg) for arg in cmdline] |
67 cmdline += ['<', util.nulldev] | 67 cmdline += ['<', util.nulldev] |
68 cmdline = util.quotecommand(' '.join(cmdline)) | 68 cmdline = ' '.join(cmdline) |
69 self.ui.debug(cmdline, '\n') | 69 self.ui.debug(cmdline, '\n') |
70 return os.popen(cmdline, 'r') | 70 return util.popen(cmdline) |
71 | 71 |
72 def run(self, cmd, *args, **kwargs): | 72 def run(self, cmd, *args, **kwargs): |
73 fp = self._run(cmd, *args, **kwargs) | 73 fp = self._run(cmd, *args, **kwargs) |
74 output = fp.read() | 74 output = fp.read() |
75 return output, fp.close() | 75 return output, fp.close() |