mtg
mtg copied to clipboard
Searching for "--type Legendary --set AKH" throws exception unpacking power/toughness
I attempted to run mtg --type Legendary --set AKH
to get a list of all legendary cards from Amonkhet. mtg threw the following exception:
Traceback (most recent call last):
File "/usr/bin/mtg", line 117, in <module>
sys.exit(main())
File "/usr/bin/mtg", line 104, in main
cards = CardExtractor(url).cards
File "/usr/lib/python3.6/site-packages/mtglib/card_extractor.py", line 60, in cards
return self.extract_many()
File "/usr/lib/python3.6/site-packages/mtglib/card_extractor.py", line 90, in extract_many
card.power, card.toughness = self.split_pow_tgh(number)
ValueError: not enough values to unpack (expected 2, got 1)
This is using Python 3.6, on Fedora 26, and the latest release (1.6.1).
I thought at first it might be because there is a mix of creature and non-creature legendaries in Amonkhet. However this appears not to be the case because running a similar search over e.g. --set KLD
works just fine... so I'm not immediately sure what the issue is.
The issue here was Nissa, Steward or Element's X loyalty. I've made a pull request.