Comment 4 for bug 1140872

Revision history for this message
Luke (tiliqua-au) wrote :

Re. comment #3 I only tested on paths with spaces in filename. It fails on folders with spaces. To fix, I changed:

--- /usr/share/nautilus-renamer/nautilus-renamer.py 2014-08-03 08:26:12.975538999 +1000
+++ bin/nautilus-renamer.py 2014-08-29 05:53:28.177893435 +1000
@@ -1061,9 +1061,10 @@
 if __name__ == '__main__':
     files = []
     # get current directory
- common_prefix = os.path.commonprefix (sys.argv[1:])[len("file://"):]
+ common_prefix = os.path.commonprefix (sys.argv[1:])#[len("file://"):]
     cwd_pos = common_prefix.rfind ('/')
     cwd = common_prefix [:cwd_pos]
+ cwd = Gio.File.new_for_uri(cwd).get_path()

     if not cwd:
         raise RuntimeError ("Unable to determine current working directory.")