andrebrait / 1g1r-romset-generator

A small utility that uses No-Intro DATs to generate 1G1R ROM sets
GNU General Public License v3.0
213 stars 20 forks source link

AttributeError: 'xml.etree.ElementTree.Element' object has no attribute 'prefix' #3

Closed TVsIan closed 4 years ago

TVsIan commented 4 years ago

I'm trying to run this on Windows, and it's throwing an error. I made sure I downloaded the parent/clone XML dat, I've tried pruning down the command line to just the regions and datfile (originally I was getting the same error with input & output folders and further filters, but I cut back to the minimum to test), and no luck. I also pulled up the datfile in a text editor just to make sure I hadn't downloaded the wrong one, and it does appear to be in xml format.

Here's the command I'm running and the full error text.

python3 generate.py -r USA,EUR -d "Nintendo - Nintendo Entertainment System (Parent-Clone) (20200127-000518).dat" Traceback (most recent call last): File "generate.py", line 831, in main(sys.argv[1:]) File "generate.py", line 548, in main filter_sample) File "generate.py", line 249, in parse_games root = datafile.parse(file, silence=True) File "E:\1g1r-romset-generator-master\datafile.py", line 2840, in parse rootObj.build(rootNode, gdscollector=gds_collector) File "E:\1g1r-romset-generator-master\datafile.py", line 1048, in build self.nsprefix = node.prefix AttributeError: 'xml.etree.ElementTree.Element' object has no attribute 'prefix'

Edit: Just tried on my MacBook, redownloaded the datfile using the link on the Wiki page directly, and get the same error.

andrebrait commented 4 years ago

Hi @TVsIan

Yes, generateDS, which I used to generate the Python code for parsing the XMLs, generates bad code for usage with Python's default XML library. It works fine with lxml, which comes installed in most Linux distributions.

I should have fixed it in version 1.0.1, which you can download here.

andrebrait commented 4 years ago

Ps.: please test it with version 1.0.1 instead of installing lxml if you can, as that can be very beneficial for other users :)

Also, if you could also test on the MacBook, that would be wonderful. I tested it mostly on Linux, so having some cross-platform testing would be nice, too.

TVsIan commented 4 years ago

That seems to work on both of them - I was able to copy the ROMs on the Windows computer, and generate the list on the Macbook without errors.

andrebrait commented 4 years ago

Awesome. I'm closing this issue then. Let me know if you face any other issues :wink:

And thanks a lot for the additional testing on the MacBook!