Message310214
> tl;dr: shutil.whatever should call startfile(..., 'edit') or xdg-open; other actions implemented by startfile are not cross-platform.
xdg-open is just a shell script that calls desktop-specific launchers. The behavior of these launchers is very different when it comes to executables. There is no guarantee that calling xdg-open for a script will open it for editing.
For example, there are 3 launchers on my XFCE machine: exo-open (native for XFCE), gvfs-open (GNOME), and kde-open. When called with a .py script with shebang line and executable bit set, exo-open and kde-open open text editor, but gvfs-open launches the script. When called for a real exe, exo-open and gvfs-open launch it, but kde-open brings a message box saying that the exe will not be started for safety reasons.
***
The patch raises NoAssociatedApplicationError when xdg-open returns 3, but this error code actually means that a launcher was not found. |
|
Date |
User |
Action |
Args |
2018-01-17 23:05:43 | plakhotich | set | recipients:
+ plakhotich, ronaldoussoren, tebeka, pitrou, larry, giampaolo.rodola, benjamin.peterson, eric.araujo, ganadist, Arfrever, r.david.murray, cvrebert, rosslagerwall, smarnach, Roman.Evstifeev, Hobson.Lane |
2018-01-17 23:05:43 | plakhotich | set | messageid: <1516230343.27.0.467229070634.issue3177@psf.upfronthosting.co.za> |
2018-01-17 23:05:43 | plakhotich | link | issue3177 messages |
2018-01-17 23:05:43 | plakhotich | create | |
|