GNOME Bugzilla – Bug 774303
Cannot save to symlinked gvfs mount
Last modified: 2016-12-07 12:07:27 UTC
Related meld issue: https://bugzilla.gnome.org/show_bug.cgi?id=774235 I was told to file here instead. I'm using Ubuntu (Lubuntu to be exact) 16.10 with libgtksourceview-3.0-1 (Version: 3.20.4-1). I noticed that since meld switched to using gtksourceview's file saving mechanism in meld 3.15.2, I could no longer save files to my gvfs mount. Specifically, I have a symlink in my home directory that points to the actual gvfs mount path (e.g. '/run/user/1000/gvfs/'). The particular error looks like: g-io-error-quark: Error opening file '/home/mscdex/sftp_mounts/sftp:host=somehost/path/to/file/being/saved': Operation not supported (15) Saving the same file with Geany or meld 3.15.1 or earlier (which uses Python's own file API) for example works just fine.
Try gvfs on the command line, for example the gvfs-cat command. I don't think GtkSourceView does something special, it uses the GFile API provided by GIO, which uses GVfs backends for different protocols.
FWIW I can load files from my gvfs sftp mount via meld just fine and so `gvfs-cat` also works. I also tried `gvfs-save` and that works just fine too. I wonder if it is specifically something related to gvfs mounts though, since the `gvfs-cat`/`gvfs-save` commands use a separate connection (sftp in my case).
Oops, submitted too soon -- I should have said that I'm *assuming* it makes a separate connection and does not use existing gvfs mounts for the `gvfs-*` commands (if it finds a match).
Try to open meld from the command line with the URI that triggers the error. For example: $ meld <file1> <file2> Then, in the same directory, do: $ gvfs-cat <file1> Does the gvfs-cat command return the same error as in Meld?
Note to Meld developers: you need to call gtk_source_file_set_mount_operation_factory() to create a GtkMountOperation, not a GMountOperation. IIRC, a GMountOperation doesn't work for a GUI.
I just tried that and that works fine. Loading isn't the problem though, it's saving, and `gvfs-save` works but not meld.
Ok, can you try with gedit? If the same problem occurs with gedit, it would be useful to have a backtrace to know where the error occurs. Do something like this: $ export G_DEBUG=all $ gdb <program> When the error occurs (if it's the first one), do: > backtrace This will work only if you see a warning/critical message in the console. If the error is displayed only in the GUI, it won't work.
Actually what would be more useful is the debug info, you need to re-compile GtkSourceView after enabling the DEBUG macro in gtksourceview/gtksourcefilesaver.c.
meld displays the error in a popup dialog box, so there is no error in the console. I compiled the same version of gtksourceview with the DEBUG enabled as you suggested and what I get in the console when saving the file in meld is: Start saving Check externally modified check_externally_modified_cb Start replacing file contents Make backup: no replace_file_cb Opening file failed: Error opening file '/home/mscdex/sftp_mounts/sftp:host=somehost/path/to/file': Operation not supported In meld though, there is a ' (15)' appended to the end of the 'Operation not supported' FWIW.
Ok, I can confirm it has to do with the symlink because directly using /run/user/1000/gvfs/... instead of the symlink which points to that directory, works.
It's more probably a bug in GVfs.
Ok.... I've filed a gvfs issue here: https://bugzilla.gnome.org/show_bug.cgi?id=774371
*** This bug has been marked as a duplicate of bug 768281 ***