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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user