This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author plakhotich
Recipients Arfrever, Hobson.Lane, Roman.Evstifeev, benjamin.peterson, cvrebert, eric.araujo, ganadist, giampaolo.rodola, larry, pitrou, plakhotich, r.david.murray, ronaldoussoren, rosslagerwall, smarnach, tebeka
Date 2018-01-17.23:05:43
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1516230343.27.0.467229070634.issue3177@psf.upfronthosting.co.za>
In-reply-to
Content
> 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.
History
Date User Action Args
2018-01-17 23:05:43plakhotichsetrecipients: + 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:43plakhotichsetmessageid: <1516230343.27.0.467229070634.issue3177@psf.upfronthosting.co.za>
2018-01-17 23:05:43plakhotichlinkissue3177 messages
2018-01-17 23:05:43plakhotichcreate