1
0
mirror of https://github.com/ciromattia/kcc synced 2026-07-11 15:33:17 +00:00

fix Access is denied with read only input folder (2013 bug) (#1387)

* fix Access is denied on read only input folders

* minimize changes
This commit is contained in:
Alex Xu
2026-07-08 17:22:23 -07:00
committed by GitHub
parent 858251f509
commit 0c1071a358
+10 -1
View File
@@ -1205,7 +1205,15 @@ def removeNonImages(filetree):
os.rmdir(root)
if not os.listdir(Path(filetree).parent):
raise UserWarning('No images detected, nested archives are not supported.')
warning = [
'No images detected.',
'',
'Possible causes:',
'',
'1) Incompatible image file extension like .jxl. Convert to .png first outside of KCC.',
'2) Nested archive: Either extract the nested archive outside of KCC or use File Fusion option.',
]
raise RuntimeError('\n'.join(warning))
def sanitizeTree(filetree, prefix='kcc'):
@@ -1254,6 +1262,7 @@ def flattenTree(filetree):
def sanitizePermissions(filetree):
os.chmod(filetree, S_IWRITE | S_IREAD | S_IEXEC)
for root, dirs, files in os.walk(filetree, False):
for name in files:
os.chmod(os.path.join(root, name), S_IWRITE | S_IREAD)