Troublesis / LOL-Video-Auto-Category

Python script which will automatically sort League of legends videos base on the game mode (currently only support normal / aram) and champion which was in the video.
1 stars 0 forks source link

PermissionError #3

Open Troublesis opened 4 years ago

Troublesis commented 4 years ago

===> Comparing victorious-sivir.jpg Traceback (most recent call last): File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.2032.0_x64__qbz5n2kfra8p0\lib\shutil.py", line 566, in move os.rename(src, real_dst) FileNotFoundError: [WinError 3] The system cannot find the path specified: 'F:/bambo/Videos/Overwolf/Game Summary/League of Legends/League of Legends_13-3-2020_23-51-57-887/' -> 'F:/bambo/Videos/Overwolf/Game Summary/Normal/Sivir/League of Legends 03-14-2020 0-02-10-892'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "f:/bambo/Google Drive/Cloud Doc/Python/League of Legends/lolVideoAutoCategory.py", line 103, in championFound = lolDetectChampion(championIconFolder,source,0.9,'normal',championName,skinName,normalGameModeDestination,videoFolderName) File "f:\bambo\Google Drive\Cloud Doc\Python\League of Legends\functionsLibrary.py", line 142, in lolDetectChampion dest = shutil.move(source, destFolder) File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.2032.0_x64qbz5n2kfra8p0\lib\shutil.py", line 578, in move rmtree(src) File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.2032.0_x64qbz5n2kfra8p0\lib\shutil.py", line 516, in rmtree return _rmtree_unsafe(path, onerror) File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.2032.0_x64__qbz5n2kfra8p0\lib\shutil.py", line 400, in _rmtree_unsafe onerror(os.unlink, fullname, sys.exc_info()) File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.2032.0_x64__qbz5n2kfra8p0\lib\shutil.py", line 398, in _rmtree_unsafe os.unlink(fullname) PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'F:/bambo/Videos/Overwolf/Game Summary/League of Legends/League of Legends_13-3-2020_23-51-57-887/League of Legends 03-14-2020 0-18-14-606.mp4'

Troublesis commented 4 years ago

It seems this happen while the file was running on some other programs. Need some code to terminate the files in order to have the permission to move the files.