Originally Posted by
ocean
I'm not sure filesystem issues are solvable with ONLY python changes.
In C++ string (std::string) is bytes and it's not required to be UTF-8 string.
C++ functions should be able take bytes, not sure why it's not working. I think if you know answer to this, you would be closed to solution.
Can we try experimenting in Trashcan.py?
Code:
for root, dirs, files in os.walk(trashfolder.encode(), topdown=False):
for name in files:
# Don't delete any per-directory config files from .Trash if the option is in use
if (config.movielist.settings_per_directory.value and name == ".e2settings.pkl"):
continue
fn = os.path.join(root, name)
st = os.stat(fn)
try:
import chardet
encoding = chardet.detect(fn)["encoding"]
fn = fn.decode(encoding=encoding)
except Exception as e:
print( type(e).__name__, e)
if st.st_ctime < self.ctimeLimit:
try:
enigma.eBackgroundFileEraser.getInstance().erase(fn)
bytesToRemove -= st.st_size
except Exception as e:
print("[Trashcan] Failed to erase file after stat.st_ctime selection:", name, " ", type(e).__name__, e)
else:
candidates.append((st.st_ctime, fn, st.st_size))
size += st.st_size
# Remove empty directories if possible