Handle non-UTF8-encoded file paths more gracefully.
authorJoel Rosdahl <joel@rosdahl.net>
Sun, 1 Aug 2004 21:01:34 +0000 (21:01 +0000)
committerJoel Rosdahl <joel@rosdahl.net>
Sun, 1 Aug 2004 21:01:34 +0000 (21:01 +0000)
src/gkofoto/handleimagesdialog.py

index 5fb5fe3..a2a29e5 100644 (file)
@@ -41,7 +41,10 @@ class HandleImagesDialog(gtk.FileSelection):
         modifiedImages = []
         movedImages = []
         for filepath in walk_files(self.get_selections()):
-            filepath = filepath.decode("utf-8")
+            try:
+                filepath = filepath.decode("utf-8")
+            except UnicodeDecodeError:
+                filepath = filepath.decode("latin1")
             try:
                 image = env.shelf.getImage(filepath)
                 if image.getLocation() == os.path.realpath(filepath):