X-Git-Url: https://git.phdru.name/?p=xsetbg.git;a=blobdiff_plain;f=rescan_fs.py;h=1b74f8f15213a4932f4e5326f134bf60e815183b;hp=346f92b28f387c3434731ec9d0e19e4949955aa2;hb=HEAD;hpb=8d05302c387169fa41f23b293c404bd3cb6561d6 diff --git a/rescan_fs.py b/rescan_fs.py index 346f92b..24302fe 100755 --- a/rescan_fs.py +++ b/rescan_fs.py @@ -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, }