Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
TVsIan opened this issue Feb 18, 2020 · 4 comments
Labels
bug Something isn't working

Comments

@TVsIan
Copy link

TVsIan commented Feb 18, 2020

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, gds_collector_=gds_collector)
File "E:\1g1r-romset-generator-master\datafile.py", line 1048, in build
self.ns_prefix_ = 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
Copy link
Owner

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 andrebrait added the bug Something isn't working label Feb 18, 2020
@andrebrait
Copy link
Owner

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
Copy link
Author

TVsIan commented Feb 18, 2020

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
Copy link
Owner

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

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants