gogrepoc icon indicating copy to clipboard operation
gogrepoc copied to clipboard

Orphaning dir fails because path already exists

Open BileDemon opened this issue 2 years ago • 0 comments

I'm using gogrepoc for a few years now, and I am very thankful that it exists, because it enables me to download and manage my entire collection which has become quite big nowadays. However, recently I have repeatedly stumbled upon this annoying bug, which appears to occur whenever a game on GOG is renamed (or removed) AND this exact game has already had orphaned file entries in the past. Thus when moving the whole game directory into the orphaned folder, it fails, because a folder named like this is already there.

Subsequently the script completely stops orphaning the remaining files, because there is no proper error handling.

This error occurred with Master of Magic and some other game, and now with Wolfenstein 3D.

I always have to manually remove/rename the problematic folders, because orphaning always fails when the folder is present.

Here is the log output:

08:25:59 | orphaning dir 'wolfenstein_3d' 08:25:59 | fatal... Traceback (most recent call last): File "gogrepoc.py", line 2891, in main(process_argv(sys.argv)) File "gogrepoc.py", line 2711, in main cmd_clean(args.cleandir, args.dryrun) File "gogrepoc.py", line 2523, in cmd_clean shutil.move(cur_fulldir, orphan_root_dir) File "/usr/lib/python3.8/shutil.py", line 789, in move raise Error("Destination path '%s' already exists" % real_dst) shutil.Error: Destination path './gog/!orphaned/wolfenstein_3d' already exists

BileDemon avatar Oct 22 '22 08:10 BileDemon