Rough fix for 1251 filepaths
authorEugene Gagarin <mosfet07@ya.ru>
Thu, 21 May 2009 11:42:55 +0000 (15:42 +0400)
committerEugene Gagarin <mosfet07@ya.ru>
Thu, 21 May 2009 11:42:55 +0000 (15:42 +0400)
src/files/search.py

index fc6feab..ca7ebef 100755 (executable)
@@ -6,6 +6,7 @@ from os import walk
 from os.path import join, abspath, normcase, isdir, getsize
 from heapq import nlargest
 from fnmatch import fnmatch
+from sys import platform
 
 from misc import size_hum_read, _
 from config import config
@@ -68,9 +69,11 @@ class Abstraction(object):
                 # Store only necessary files
                 for mask in file_filter:
                     if fnmatch(fname, mask):
-                        # Crutch for non-unicode names
-                        #flpath = unicode(join(dirpath, fname), '1251')
-                        flpath = join(dirpath, fname)
+                        if platform == 'win32':
+                            # Crutch for non-unicode names
+                            flpath = unicode(join(dirpath, fname), '1251')
+                        else:
+                            flpath = join(dirpath, fname)
                         # Show current path
                         self.presentation.show_current_status(flpath)
                         # Stop search via 'stopit' signal