eddie3 / gogrepo

Python-based tool for downloading all your GOG.com game and bonus collections to your local computer for full offline enjoyment.
481 stars 114 forks source link

Download/Unicode error #68

Closed oriwheb closed 1 year ago

oriwheb commented 1 year ago

I'm getting a 'UnicodeDecodeError' for unclear reasons. I tried recreating the manifest and even went as far as trying a fresh copy of gogrepo in an empty folder, same thing happens.

19:40:35 | pass bad_mojo_redux_avatar.zip 19:40:35 | pass bad_mojo_redux_concept_art.zip 19:40:35 | pass bad_mojo_redux_gallery.zip 19:40:35 | {banished} 19:40:35 | download setup_banished_641.0.7(14938).exe 19:40:35 | download setup_banished_321.0.7(14938).exe 19:40:35 | {bastion} 19:40:35 | fatal... Traceback (most recent call last): File "F:\Games\GOG\gogrepo-master\gogrepo.py", line 1172, in main(process_argv(sys.argv)) File "F:\Games\GOG\gogrepo-master\gogrepo.py", line 1152, in main cmd_download(args.savedir, args.skipextras, args.skipgames, args.skipids, args.dryrun, args.id) File "F:\Games\GOG\gogrepo-master\gogrepo.py", line 823, in cmd_download with ConditionalWriter(os.path.join(item_homedir, INFO_FILENAME)) as fd_info: File "F:\Games\GOG\gogrepo-master\gogrepo.py", line 221, in exit for (new_chunk, old_chunk) in zip_longest(tmp, orig): File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.2544.0_x64qbz5n2kfra8p0\lib\codecs.py", line 714, in next return next(self.reader) File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.2544.0_x64qbz5n2kfra8p0\lib\codecs.py", line 645, in next line = self.readline() File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.2544.0_x64qbz5n2kfra8p0\lib\codecs.py", line 558, in readline data = self.read(readsize, firstline=True) File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.2544.0_x64qbz5n2kfra8p0\lib\codecs.py", line 504, in read newchars, decodedbytes = self.decode(data, self.errors) UnicodeDecodeError: 'utf-8' codec can't decode byte 0xdf in position 0: invalid continuation byte

Upon some further research, the !info.txt file for Bastion looks like this: 

So I guess the error is warranted. I'll try to recreate it once more...

oriwheb commented 1 year ago

Turns out it was defective !info.txt files for several games. For some reason the same games had their info files defective consecutively, which led me to wrong conclusions at first.

The solution was to delete the !info.txt files for those games and then run python ./gogrepo.py update -os windows -lang en -id <gameid> for each game. Running the command without deleting the !info.txt file first resulted in the error persisting, at least for me.

elyashivhazan commented 1 year ago

@oriwheb Do a checksum for you files, your drive might got some probables.