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

Issue processing discogs_20250101_artists.xml file failed on processing members element #149

Closed
ijabz opened this issue Jan 23, 2025 · 1 comment

Comments

@ijabz
Copy link
Collaborator

ijabz commented Jan 23, 2025

Failing second row

<artist><id>2</id><name>Mr. James Barth &amp; A.D.</name><data_quality>Correct</data_quality><namevariations><name>MR JAMES BARTH &amp; A. D.</name><name>Mr Barth &amp; A.D.</name><name>Mr. Barth &amp; A.D.</name><name>Mr. James Barth &amp; A. D.</name></namevariations><aliases><name id="2470">Puente Latino</name><name id="19536">Yakari &amp; Delano</name><name id="103709">Crushed Insect &amp; The Sick Puppy</name><name id="384581">ADCL</name><name id="1779857">Alexi Delano &amp; Cari Lekebusch</name></aliases><members><name id="26">Alexi Delano</name><name id="27">Cari Lekebusch</name></members></artist>

Traceback (most recent call last):
  File "run.py", line 23, in <module>
    sys.exit(main(arguments))
  File "/home/ubuntu/code/discogs-xml2db/discogsxml2db/exporter.py", line 325, in main
    exporter.export()
  File "/home/ubuntu/code/discogs-xml2db/discogsxml2db/exporter.py", line 71, in export
    return self.export_from_file(self.openfile())
  File "/home/ubuntu/code/discogs-xml2db/discogsxml2db/exporter.py", line 123, in export_from_file
    for cnt, entity in enumerate(filter(self.validate, self.parser.parse(fp)), start=1):
  File "/home/ubuntu/code/discogs-xml2db/discogsxml2db/parser.py", line 86, in parse
    yield self.build_entity(i, element)
  File "/home/ubuntu/code/discogs-xml2db/discogsxml2db/parser.py", line 142, in build_entity
    setattr(artist, t, list(self.element_members(e)))
  File "/home/ubuntu/code/discogs-xml2db/discogsxml2db/parser.py", line 117, in element_members
    yield int(id), name.strip()
ValueError: invalid literal for int() with base 10: 'Alexi Delano'

When I compare with an older file discogs_20240601_artists.xml you can see that contains an id element with the same valiue as well as the id attribute, this sppears to have been removed becuase unnecessary but code expects it
<members><id>26</id><name id="26">Alexi Delano</name><id>27</id><name id="27">Cari Lekebusch</name></members>

@ijabz ijabz changed the title Issue processing discogs_20250101_artists.xml file failed on member Alexi Delano Issue processing discogs_20250101_artists.xml file failed on processing members element Jan 23, 2025
ijabz added a commit that referenced this issue Jan 23, 2025
…cessing members element

Fixed members so handles id element being moved to an attrbiute of the name element.
@ijabz
Copy link
Collaborator Author

ijabz commented Jan 23, 2025

Fixed

@ijabz ijabz closed this as completed Jan 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant