mirror of
https://github.com/rembo10/headphones.git
synced 2026-03-22 20:59:27 +00:00
Added try/except block to the folder chmod'ing - thanks to caulfie1d for the heads up
This commit is contained in:
@@ -409,13 +409,18 @@ def moveFiles(albumpath, release, tracks):
|
||||
logger.warn('Error moving file %s: %s' % (files, e))
|
||||
|
||||
# Chmod the directories using the folder_format (script courtesy of premiso!)
|
||||
folder_list = folder.split('/')
|
||||
|
||||
folder_list = folder.split('/')
|
||||
temp_f = headphones.DESTINATION_DIR
|
||||
|
||||
for f in folder_list:
|
||||
|
||||
temp_f = os.path.join(temp_f, f)
|
||||
os.chmod(os.path.normpath(temp_f).encode(headphones.SYS_ENCODING), int(headphones.FOLDER_PERMISSIONS, 8))
|
||||
|
||||
|
||||
try:
|
||||
os.chmod(os.path.normpath(temp_f).encode(headphones.SYS_ENCODING), int(headphones.FOLDER_PERMISSIONS, 8))
|
||||
except Exception, e:
|
||||
logger.error("Error trying to change permissions on folder: %s" % temp_f)
|
||||
|
||||
# If we failed to move all the files out of the directory, this will fail too
|
||||
try:
|
||||
shutil.rmtree(albumpath)
|
||||
|
||||
Reference in New Issue
Block a user