Bug 20735 - wine wants to open shell scripts
Summary: wine wants to open shell scripts
Status: RESOLVED NOTABUG
Alias: None
Product: shared-mime-info
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Hardware: All All
: medium normal
Assignee: Jonathan Blandford
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-03-18 12:32 UTC by Tyler Rick
Modified: 2009-04-20 09:12 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description Tyler Rick 2009-03-18 12:32:58 UTC
When I try to open a non-executable shell script (including ruby and python scripts) from Nautilus, Nautilus asks Wine to open it.

Expected behavior:
A text editor should open the script file.

Originally reported here: https://bugs.launchpad.net/ubuntu/+source/wine/+bug/192122/ and was told to report it on bugs.freedesktop.org. So since I couldn't find the bug in the database here already, I'm reporting it.

------------------------------------------
Scott Ritchie wrote on 2008-08-01:

Ok, I can now confirm this and I believe I know the source of the issue. The problem occurs with shell scripts, python scripts, ruby scripts, and possibly others.

Basically, Wine is (correctly) associated with MIME type "Application/x-executable", since this covers some .exe files (including non-Windows ones generated by Winelib). shared-mime-info classifies shell, python, and ruby scripts as sub-classes of application/x-executable, so anything that can open x-executables is used to open the scripts (in this case Wine). Since "sub-type of executable" is listed before "sub-type of text file" for scripts, handlers for executables (Wine) show up before handlers for text files, and thus Wine gets used to open it.

One possible fix is to get rid of the sub-typing in shared-mime-info. It's unlikely anything that could open "executables" should also be opening python/ruby scripts in this way (in fact Wine is probably the only program associated with executables at all). Another possible workaround is to just switch text/application so that the default becomes the text editor handler, but this leaves the problem with Wine still being listed as a handler for something it isn't.
Comment 1 Bastien Nocera 2009-04-20 09:12:22 UTC
Wine should use "application/x-ms-dos-executable", and there's certainly no "
    <glob pattern="*.exe"/>" for Linux executables in shared-mime-info.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.