Blob Blame History Raw
--- comix-4.0.4/src/filehandler.py.missing	2009-01-12 05:54:42.000000000 +0900
+++ comix-4.0.4/src/filehandler.py	2010-03-18 02:56:06.000000000 +0900
@@ -466,7 +466,14 @@
         archive in that archive's directory listing, sorted alphabetically.
         """
         arch_dir = os.path.dirname(self._base_path)
-        files = os.listdir(arch_dir)
+        # arch_dir may not exist, for example the archive being currently opened
+        # was in somoe removable media.
+        try:
+            files = os.listdir(arch_dir)
+        except OSError:
+            self._window.statusbar.set_message(
+                _('Could not open %s: No such directory.') % arch_dir)
+            return
         files.sort(locale.strcoll)
         try:
             current_index = files.index(os.path.basename(self._base_path))
@@ -483,7 +490,14 @@
         archive in that archive's directory listing, sorted alphabetically.
         """
         arch_dir = os.path.dirname(self._base_path)
-        files = os.listdir(arch_dir)
+        # arch_dir may not exist, for example the archive being currently opened
+        # was in somoe removable media.
+        try:
+            files = os.listdir(arch_dir)
+        except OSError:
+            self._window.statusbar.set_message(
+                _('Could not open %s: No such directory.') % arch_dir)
+            return
         files.sort(locale.strcoll)
         try:
             current_index = files.index(os.path.basename(self._base_path))