DisplayBug:20095 Python crash displaying the ISBN in search results

From ISFDB
Jump to navigation Jump to search

DisplayBug:20095 Python crash displaying the ISBN in search results OPEN From Advanced Search I did a publication search for the author Neal Barrett, Jr. There is a Python crash (see attached) trying to display the ISBN for the first search result which is Aldair in Albion. Marc Kupper 00:44, 23 Jan 2007 (CST)

Record 	Title 	Authors 	Year 	Pages 	Tag 	Binding 	Type 	ISBN 	Price 	Publisher
1914 	Aldair in Albion 	Neal Barrett, Jr. 	1976 	205 	LDRNLBN1976 	pb 	NOVEL
 
 
ValueError	Python 2.4.2: /usr/local/bin/python
Tue Jan 23 00:39:03 2007

A problem occurred in a Python script. Here is the sequence of function calls leading up to the error, in the order they occurred.
 /www/isfdb.tamu.edu/root/cgi-bin/edit/pp_search.cgi
  228         PrintTableColumns()
  229         while record:
  230                 PrintPubRecord(record, bgcolor)
  231                 bgcolor ^= 1
  232                 record = result.fetch_row()
PrintPubRecord = <function PrintPubRecord>, record = ((1914L, 'Aldair in Albion', 'LDRNLBN1976', '1976-00-00', 43L, '205', 'pb', 'NOVEL', '#451UY1235125', None, '$1.25', None),), bgcolor = 1
 /www/isfdb.tamu.edu/root/cgi-bin/edit/pp_search.cgi in PrintPubRecord(record=((1914L, 'Aldair in Albion', 'LDRNLBN1976', '1976-00-00', 43L, '205', 'pb', 'NOVEL', '#451UY1235125', None, '$1.25', None),), bgcolor=1)
   67         print "<td>" +record[0][PUB_CTYPE]+ "</td>"
   68         if record[0][PUB_ISBN]:
   69                 print "<td>" +convertISBN(record[0][PUB_ISBN])+ "</td>"
   70         else:
   71                 print "<td>?</td>"
global convertISBN = <function convertISBN>, record = ((1914L, 'Aldair in Albion', 'LDRNLBN1976', '1976-00-00', 43L, '205', 'pb', 'NOVEL', '#451UY1235125', None, '$1.25', None),), global PUB_ISBN = 8
 /www/isfdb.tamu.edu/root/cgi-bin/edit/library.py in convertISBN(isbn='#451UY1235125')
   47                         retval = isbn
   48         elif newISBN[0] == '1':
   49                 group2 = int(newISBN[1:3])
   50                 group4 = int(newISBN[1:5])
   51                 if (group2 >= 0) and (group2 <= 9):
group2 undefined, builtin int = <type 'int'>, newISBN = '1UY1235125'

ValueError: invalid literal for int(): UY
      args = ('invalid literal for int(): UY',)