Sunflower icon indicating copy to clipboard operation
Sunflower copied to clipboard

Can't execute (open) files if provider is URI based

Open cmallwitz opened this issue 4 years ago • 0 comments

Using latest develop branch on Ubuntu 19.10, I can't open (double clicking) files in external application.

How to reproduce:

  • open ftp://[email protected]/ in Nautilus to mount it in Gnome
  • in Sunflower from context menu, "Enter path.." ftp://[email protected]/
  • Sunflower will display content of FTP directory
  • navigate to e.g. /pub/vim/
  • double click file "green_ball.gif" (at end)
  • this launches external image viewer but with an error that it can't find the file

I had a break point here:

  File "/home/christian/tech/IdeaProjects/Sunflower/sunflower/__main__.py", line 224, in <module>
    exit_status = application.run(sys.argv)
  File "/usr/lib/python3/dist-packages/gi/overrides/Gio.py", line 44, in run
    return Gio.Application.run(self, *args, **kwargs)
  File "/home/christian/tech/IdeaProjects/Sunflower/sunflower/plugin_base/item_list.py", line 528, in _handle_button_press
    self._execute_selected_item(widget)
  File "/home/christian/tech/IdeaProjects/Sunflower/sunflower/plugins/file_list/file_list.py", line 468, in _execute_selected_item
    self._parent.associations_manager.execute_file(selected_file, provider=self.get_provider())
  File "/home/christian/tech/IdeaProjects/Sunflower/sunflower/associations.py", line 314, in execute_file
    self.open_file((path,), default_application)
  File "/home/christian/tech/IdeaProjects/Sunflower/sunflower/associations.py", line 212, in open_file
    if application_info is not None:

In open_file()

  • argument selection {tuple: 1} 'ftp://[email protected]/pub/vim/green_ball.gif'
  • application (Gio.DesktopAppInfo) is retrieved with application.supports_uris() = True
  • convert selection to {list} ['file://ftp%3A//anonymous%40ftp.mirrorservice.org/pub/vim/green_ball.gif']

You can see the selection has an incorrect path for the external image viewer. The same happens if double clicking on files on a Samba share were the base URI is smb://...

cmallwitz avatar May 28 '20 21:05 cmallwitz