[meld: 1/2] Fix FUSE directory comparisons




commit 0eef20674af82fdd36bc18a7d34e62398868fb59
Author: mscdex <mscdex mscdex net>
Date:   Fri Jan 29 20:26:35 2021 +0000

    Fix FUSE directory comparisons
    
    According to the `is_native()` docs:
    
    > On some systems non-native files may be available using the native
    > filesystem via a userspace filesystem (FUSE), in these cases this
    > call will return `False`, but `gio.File.get_path()` will still
    > return a native path.
    
    So calling `get_path()` and checking its result should allow us to
    detect directories from FUSE filesystems and thus avoid the error.

 meld/meldapp.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/meld/meldapp.py b/meld/meldapp.py
index e2e2fbf6..dee076ad 100644
--- a/meld/meldapp.py
+++ b/meld/meldapp.py
@@ -331,8 +331,9 @@ class MeldApp(Gtk.Application):
             # TODO: support for directories specified by URIs
             file_type = f.query_file_type(Gio.FileQueryInfoFlags.NONE, None)
             if not f.is_native() and file_type == Gio.FileType.DIRECTORY:
-                raise ValueError(
-                    _("remote folder “{}” not supported").format(arg))
+                if f.get_path() is None:
+                    raise ValueError(
+                        _("remote folder “{}” not supported").format(arg))
 
             return f
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]