> On Sep 23, 2016, at 12:47, Matt Mackall <m...@selenic.com> wrote:
> 
> On Thu, 2016-09-22 at 18:20 -0500, Kevin Bullock wrote:
>>> 
>>> On Sep 22, 2016, at 13:21, Matt Mackall <m...@selenic.com> wrote:
[...]
>>> +        try:
>>> +            src = util.popen(cmd)
>> Erm, don't we want to use util.popen2 or one of the other variants that use
>> subprocess instead?
> 
> The universal advantages of subprocess are overstated. For the simple task of
> reading stdout from a subprocess, util.popen is perfectly suited. If it 
> wasn't..
> we'd fix util.popen.

Related to my reply below: if we use popen, does stderr not get captured? I.e. 
will the user see the stderr output in their terminal?

>> ...and maybe handle ENOENT gracefully?
> 
> We can't, because cmd is an arbitrary shell expression.

I mean that it would be nice to inform a user somehow that their arbitrary 
shell expression failed and what the error was (ENOENT meaning "command not 
found" in this case).

pacem in terris / мир / शान्ति / ‎‫سَلاَم‬ / 平和
Kevin R. Bullock

_______________________________________________
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

Reply via email to