Daniel Plakhotich <daniel.plakhot...@gmail.com> added the comment: > 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. ---------- nosy: +plakhotich _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue3177> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com