]> git.phdru.name Git - xsetbg.git/blobdiff - rescan_fs.py
Fix(DB): Fix column encoding
[xsetbg.git] / rescan_fs.py
index 346f92b28f387c3434731ec9d0e19e4949955aa2..24302fea4966a2f7259077ac8d24e65813dea435 100755 (executable)
@@ -52,7 +52,7 @@ NULL = open(os.devnull, 'w')
 
 def is_image(full_path):
     # Run `identify` from ImageMagic; convert retcode to bool
-    return not subprocess.call(['identify', full_path],
+    return not subprocess.call(['identify', full_path.encode(fs_encoding)],
                                stdout=NULL, stderr=subprocess.STDOUT)
 
 
@@ -67,7 +67,7 @@ with SQLiteMassInsert() as txn:
                 try:
                     row = xsetbg_db.byFull_name(full_name)
                 except SQLObjectNotFound:
-                    values = {'full_name': full_name.encode('utf-8'),
+                    values = {'full_name': full_name,
                               'is_image': is_image(full_name),
                               'flag': True,
                               }