GNOME Bugzilla – Bug 774235
Cannot save to gvfs mount
Last modified: 2016-11-13 20:19:51 UTC
IIRC before I upgraded to Ubuntu 16.10 (which upgraded my copy of meld) I was able to save files located in a gvfs (sftp) mount. I don't recall what version I had previously, but the error I get when trying to save within meld is: Couldn't save file due to: g-io-error-quark: Error opening file '/home/mscdex/sftp_mounts/sftp:host=somehost/path/to/file/being/saved': Operation not supported (15) I tried searching for the error but didn't really come up with a whole lot. I should note that the 'sftp_mounts' in my home directory is actually a symlink to '/run/user/1000/gvfs/' for convenience. It does not appear to be a permission issue since I can save to the exact same file in my text editor, which is exactly what I'm having to do right now if I need to copy changes over from the diff. On an unrelated note, it would be nice to be able to highlight and copy error messages from error popup windows...
I've been able to narrow down the breakage to have happened between 3.15.1 and 3.15.2.
bisecting reveals ffd28fcd4ad08be928d9d4aa8a0a4dae04916a71 is the first bad commit
Created attachment 339666 [details] [review] Patch to make this issue always show error message (no silent saving fail) I tried to reproduce this issue and it looks to be glib-or-gtksource related problem with handling symbolic links to gvfs mounts in glib applications. The file ~/symlink-to-run-user-1000-gvfs/sftp\:host\=localhost/tmp/README can be saved with vim editor, but can't with meld and gedit. Symbolic links or gvfs mounts without each other are working fine. By the way while tring to reproduce this issue I found that no error message appears while file wasn't saved and save icon was left in enabled state. It revealed that lots of error messages are just lost in meld 3.16 due to encoding problems if glib returns error message translated to non-ascii language, because python tries to use ascii codec on uncide + str concatenation and formatting. Attaching patch to fix displaying of several error messages.
(In reply to Brian from comment #0) > On an unrelated note, it would be nice to be able to highlight and copy > error messages from error popup windows... Unfortunately, this appears to be a GTK+ change. In my testing, copying text from GtkMessageDialogs works fine in GTK+ 3.18 and fails in 3.20. I haven't tested 3.22. (In reply to Vasily Galkin from comment #3) > The file ~/symlink-to-run-user-1000-gvfs/sftp\:host\=localhost/tmp/README > can be saved with vim editor, but can't with meld and gedit. (In reply to Brian from comment #2) > bisecting reveals ffd28fcd4ad08be928d9d4aa8a0a4dae04916a71 is the first bad > commit This makes sense, since the bisected commit is the one where we switched over to using GtkSourceView's file loader + saver. Can I ask that you please file a bug against GtkSourceView, if Vasily's description seems to be what you're seeing?
Review of attachment 339666 [details] [review]: Minor comment below, but otherwise this all looks good to me, thanks! Best I can tell, I wouldn't expect any of these issues to show up in current master with the python 3 changes. I don't suppose you've tested this? ::: meld/dirdiff.py @@ +964,3 @@ + msg = err.message.encode('utf8', 'replace') + else: + msg = str(err) Can we do an isinstance(err.message, unicode) style check instead here? It feels weird to me to special-case the exception itself.
> Best I can tell, I wouldn't expect any of these issues to show up in current > master with the python 3 changes. I don't suppose you've tested this? I tested current master in a sketchy way and didn't see any exception related to similar error messages, all of them were displayed. So it looks fine Though I didn't test current master behavior with symlink-to-gvfs-mount situation described in this bug.
Created attachment 339730 [details] [review] Patch to make this issue always show error message (no silent saving fail) Converted patch to checking type of args[0] property. Not the message property, because according to http://legacy.python.org/dev/peps/pep-0352/#transition-plan it looks that message property was deprecated since python2.6 and it is not clear why current python2.7 doesn't give a deprecation warning about it. Also some explanations were added to commit text.
I've submitted an upstream bug report here: https://bugzilla.gnome.org/show_bug.cgi?id=774303
(In reply to Vasily Galkin from comment #7) > Created attachment 339730 [details] [review] [review] > Patch to make this issue always show error message (no silent saving fail) > > Converted patch to checking type of args[0] property. > > Not the message property, because according to > http://legacy.python.org/dev/peps/pep-0352/#transition-plan it looks that > message property was deprecated since python2.6 and it is not clear why > current python2.7 doesn't give a deprecation warning about it. > > Also some explanations were added to commit text. Looks good to me. I've just pushed this to the 3.16 branch. Thanks again! (In reply to Brian from comment #8) > I've submitted an upstream bug report here: > https://bugzilla.gnome.org/show_bug.cgi?id=774303 Thanks for that. If after that fix we're still doing something wrong, please feel free to reopen this. In the meantime, I'm going to close this bug.