gogrepo
gogrepo copied to clipboard
Fix ValueError: invalid mode: 'rUb'
File mode U
is deprecated in Python 3 https://docs.python.org/3/library/functions.html#open
Full error generated with Python 3.11:
E:\GOG Games>gogrepo.py update
13:06:14 | loading local manifest...
13:06:14 | fatal...
Traceback (most recent call last):
File "E:\GOG Games\gogrepo.py", line 1170, in
Thanks. Will fix this.
Just as a quick fix for anyone having this problem, at least on linux systems, find the line and replace 'rU' with 'r' (simply remove the U), and it should work again.
On other OSses, the keyword newline might be necessary (something like
codecs.open(MANIFEST_FILENAME, 'r', 'utf-8', newline="\r\n") as r:
may be needed in windows, untested!)
Just tried the fix from @WisdomCode on my Windows10 system and found that removing the U was enough; adding a newline argument returned TypeError: open() got an unexpected keyword argument 'newline'
. Hope this helps!
Worked for me as well on Windows, thanks!