Author eric.araujo
Recipients benjamin.peterson, cool-RR, cvrebert, eric.araujo, ganadist, giampaolo.rodola, rosslagerwall, vstinner
Date 2011-07-15.15:25:47
SpamBayes Score 0.00291241
Marked as misclassified No
Message-id <1310743548.64.0.723898174116.issue3177@psf.upfronthosting.co.za>
In-reply-to
Content
>> dependencies: + Finding programs in PATH, adding shutil.which
> Why did you add this dependency? For example, subprocess is able to
> locate a program if the program has no full path. We don't need a
> which function.

While the Windows API call is part of Windows and the open program always present on Mac OS X, xdg-open is an optional program on free OSes, so I thought we’d need shutil.which to look before we leap.  The alternative is to call Popen(['xdg-open', etc.]) and check if we get ENOENT, but I don’t know if this would be non-ambiguous (for example, do we get ENOENT if xdg-open exists but not the file?).

A related question: what to do when we’re not on Windows nor Mac and xdg-open doesn’t exist?  Raise NotImplemented?
History
Date User Action Args
2011-07-15 15:25:48eric.araujosetrecipients: + eric.araujo, vstinner, giampaolo.rodola, benjamin.peterson, ganadist, cvrebert, cool-RR, rosslagerwall
2011-07-15 15:25:48eric.araujosetmessageid: <1310743548.64.0.723898174116.issue3177@psf.upfronthosting.co.za>
2011-07-15 15:25:48eric.araujolinkissue3177 messages
2011-07-15 15:25:47eric.araujocreate