Error when result has only one card

Bug #532379 reported by Xisberto
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MagicLibrary
Fix Committed
Medium
Xisberto

Bug Description

When search returns only one card, Gatherer shows the card's page, and not the table of results. It generates a IndexError like code bellow:

Exception in thread Thread-3:
Traceback (most recent call last):
  File "/usr/lib/python2.6/threading.py", line 525, in __bootstrap_inner
    self.run()
  File "/usr/lib/python2.6/threading.py", line 477, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/home/xisberto/Projetos/magiclibrary/magiclibrary_gatherer.py", line 190, in _start
    for ret in self.generator(*args, **kwargs):
  File "/home/xisberto/Projetos/magiclibrary/magiclibrary_gatherer.py", line 44, in readSock
    self.parser.feed(html_source)
  File "/usr/lib/python2.6/sgmllib.py", line 104, in feed
    self.goahead(0)
  File "/usr/lib/python2.6/sgmllib.py", line 138, in goahead
    k = self.parse_starttag(i)
  File "/usr/lib/python2.6/sgmllib.py", line 296, in parse_starttag
    self.finish_starttag(tag, attrs)
  File "/usr/lib/python2.6/sgmllib.py", line 345, in finish_starttag
    self.handle_starttag(tag, method, attrs)
  File "/usr/lib/python2.6/sgmllib.py", line 381, in handle_starttag
    method(attrs)
  File "/home/xisberto/Projetos/magiclibrary/magiclibrary_gatherer.py", line 122, in start_table
    table_class = [v for k, v in attrs if k=="class"][0]
IndexError: list index out of range

A search which returns only one card: http://gatherer.wizards.com/Pages/Search/Default.aspx?type=+[Planeswalker]+[Ajani]||subtype=+[Ajani]&color=+[R]

Xisberto (xisberto)
Changed in magiclibrary:
importance: Undecided → Medium
assignee: nobody → Xisberto (xisberto)
status: New → Confirmed
Revision history for this message
Xisberto (xisberto) wrote :

Resolved in revision 13.

Changed in magiclibrary:
status: Confirmed → Fix Committed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.