Éric Araujo <mer...@netwok.org> added the comment:

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.)

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue3177>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to