Files: Unable to open .py files in IDLE [$20]

Created on 12 Mar 2019  路  11Comments  路  Source: elementary/files

In Gnome 3.28 it works.

Steps to reproduce:

  1. Install idle-python3.6
    By default, Python scripts are opened in Code. In Gnome, they can easily be opened in IDLE by double click. Then there will be a description of the attempt to open through the context menu.
  2. Right-click on the shortcut of any Python script
  3. Open in*
  4. Other application*
  5. View all applications*
    You will not see IDLE in the list.

*Menu item names were translated by Google.


There is a $20 open bounty on this issue. Add to the bounty at Bountysource.

Bounty Out of Scope

All 11 comments

This seems to be a 'feature' of the IDLE package. There is a workround as follows:

  • Edit the file /usr/share/applications/idle-python-3.6.desktop (as administrator) to add the line:
Mimetype=text/x-python
  • In the terminal run sudo update-desktop-database

The app should now appear in "Open With" sub menu.

I am not entirely sure why the app does not even appear in "Other Applications" - I'll look into fixing that.

Thanks for the instruction!
I think it would be great when it works by default, like in Fedora.

This seems to be an issue with Gtk.AppChooserDialog which, for some reason, is refusing to list this app even when "Show all applications" is pressed (despite showing some inappropriate applications). I'll continue to try and fix.

The fix for getting IDLE to list in "All other applications" is to change the desktop file Exec line to:

Exec=/usr/bin/idle-python3.6 %U

Clearly, to open a file with an application, the application must be capable of receiving the file location as a parameter. The desktop file in the IDLE package indicates that the application does not accept a file commandline parameter so the dialog does not list it.

Therefore I am not convinced that this is a Files bug.

It maybe that in Fedora a correct package is supplied.

Yes, it works.

P.S. You can take this bounty to motivate your's further development of OS. I will confirm it.

Thanks!

I've just submitted a patch upstream to Debian to try and get them to accept these changes in the Python packaging. You are indeed right that Fedora have written a custom desktop file that includes the necessary fields: https://src.fedoraproject.org/cgit/rpms/python3.git/tree/idle3.desktop

If Debian accept the patch, it'll probably be a long time before it makes its way into Ubuntu and hence elementary, but it was a quick patch that was worthwhile pursuing.

https://salsa.debian.org/cpython-team/python3/merge_requests/3

Thanks David - I was considering of doing that but you beat me to it! Probably you are more deserving of the bounty in that case as you have an actual PR that fixes the fundamental issue.

That's OK, you work much harder on Files than I do, so claim the bounty if you wish. Or, I think it's possible for @PlatonB to remove it from this issue and assign it to another of their choosing if they wish.

Closing since it looks like we fixed this upstream

@davidmhewitt
As I can see, Debian has still not accepted this patch. Is it possible to give it life through Ubuntu? Can you put it directly into the elementary OS?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

tintou picture tintou  路  6Comments

sprite-1 picture sprite-1  路  4Comments

micahilbery picture micahilbery  路  5Comments

CodingSpiderFox picture CodingSpiderFox  路  5Comments

tintou picture tintou  路  5Comments