import os
import subprocess
+
from sqlobject import SQLObjectNotFound
from sqlobject.sqlbuilder import Insert, Update, Delete
+from m_lib.defenc import default_encoding
+
from xsetbg_conf import xsetbg_dir, xsetbg_conf
from xsetbg_db import recreate_db, SQLiteMassInsert
# List images in all subdirectories
for dirpath, dirs, files in os.walk(image_dir):
for file in files:
- full_name = os.path.join(dirpath, file).decode(fs_encoding)
+ if default_encoding != fs_encoding:
+ file = file.encode().decode(fs_encoding)
+ full_name = os.path.join(dirpath, file)
try:
row = xsetbg_db.byFull_name(full_name)
except SQLObjectNotFound: