X-Git-Url: https://git.phdru.name/?a=blobdiff_plain;f=rescan_fs.py;h=24302fea4966a2f7259077ac8d24e65813dea435;hb=refs%2Ftags%2F5.1.2;hp=346f92b28f387c3434731ec9d0e19e4949955aa2;hpb=8d05302c387169fa41f23b293c404bd3cb6561d6;p=xsetbg.git 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, }