Author eric.araujo
Recipients Arfrever, Hobson.Lane, Roman.Evstifeev, benjamin.peterson, cvrebert, eric.araujo, ganadist, giampaolo.rodola, larry, pitrou, r.david.murray, rosslagerwall, smarnach, tebeka
Date 2012-05-29.05:11:11
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1338268272.31.0.883975147165.issue3177@psf.upfronthosting.co.za>
In-reply-to
Content
The latest discussion on this thread does not match my UNIX user model.

tl;dr: shutil.whatever should call startfile(..., 'edit') or xdg-open; other actions implemented by startfile are not cross-platform.

> Well, so how about on UNIX shutil.launch (or whatever it's called) first checks to see if we're
> referring to a file.  If we are, check to see if it's marked executable.  If it is, execute it
> under a shell.  Failing *that* we could run xdg-open where available.
This makes sense from an os.startfile perspective, but not for an xdg-open user.  xdg-open (and shutil.whatever in my eyes) only starts an application with the passed argument; that’s it.  There is no execute action because that’s done otherwise (in Python, with subprocess and os.exec*; in the shell, with program invocation (i.e. “program” or “/full/path/to/file”) using shebangs or binfmt-format).  So in my mental model, using xdg-open to have a file or URI opened by a configured application (which can be graphical or command-line) has nothing to do with executing a file.

(There was an older system on UNIX named mailcap where you could register console and GUI actions for different actions, like edit and print, but it’s not used by current graphical mail clients like Thunderbird or by the xdg-open system, so I would not consider it at all.)
History
Date User Action Args
2012-05-29 05:11:12eric.araujosetrecipients: + eric.araujo, tebeka, pitrou, larry, giampaolo.rodola, benjamin.peterson, ganadist, Arfrever, r.david.murray, cvrebert, rosslagerwall, smarnach, Roman.Evstifeev, Hobson.Lane
2012-05-29 05:11:12eric.araujosetmessageid: <1338268272.31.0.883975147165.issue3177@psf.upfronthosting.co.za>
2012-05-29 05:11:11eric.araujolinkissue3177 messages
2012-05-29 05:11:11eric.araujocreate