unexpectedpanda / retool

Retool: a better filter tool for Redump and No-Intro DAT files.
BSD 3-Clause "New" or "Revised" License
343 stars 22 forks source link

Error with version retool-2.02.1 #302

Closed maxexcloo closed 5 months ago

maxexcloo commented 5 months ago

Describe the bug A clear and concise description of what the bug is.

To reproduce Run retool.py with python.

Expected behavior

max.schaefer@mini:/Volumes/Data/media/games/test$ cd retool-2.02.0/
max.schaefer@mini:/Volumes/Data/media/games/test/retool-2.02.0$ python3 retool.py 

Retool 2.02.0
-------------
Filters DATs from Redump (http://redump.org/) and No-Intro
(https://www.no-intro.org/) to remove titles you don't want. A new DAT
file is automatically generated, the original file isn't altered.

Usage: retool.py <input DAT/folder> <options>

OR to download updated clone lists:

retool.py --update

Type retool.py -h for all options

Operating system macOS

Retool edition retool.py

Retool version retool-2.02.1

Additional context

max.schaefer@mini:/Volumes/Data/media/games/test$ cd retool-2.02.1/
max.schaefer@mini:/Volumes/Data/media/games/test/retool-2.02.1$ python3 retool.py 
Traceback (most recent call last):
  File "/Volumes/Data/media/games/test/retool-2.02.1/retool.py", line 35, in <module>
    from modules.output import WriteFiles
  File "/Volumes/Data/media/games/test/retool-2.02.1/modules/output.py", line 327
    f'\t\t<{rom['type']} {" ".join(rom_xml)}/>\n')
                 ^^^^
SyntaxError: f-string: unmatched '['
unexpectedpanda commented 5 months ago

Weirdly this works perfectly fine on Windows... which it shouldn't.

Edit: Looks like this was a Python 3.12 change that allows quote reuse. Still, those on earlier Python versions need this change.

I hope you're willing to test something for me. Open modules/output.py, and go to line 327.

Replace:

f'\t\t<{rom['type']} {" ".join(rom_xml)}/>\n')

With:

f'\t\t<{rom["type"]} {" ".join(rom_xml)}/>\n')

It looks like this should be the only line with the issue. If you have no further problems, I'll push out a new version with that change to fix the issue.

maxexcloo commented 5 months ago

Yup that fixed it! I should note I'm on 3.11 though, if that makes any difference 👍🏻

unexpectedpanda commented 5 months ago

Thanks for your help :) I've updated the modules/output.py file in the repo. No need for a version increment on this one I think.