If there are two (or more spaces) between the author's name and the suffix, e.g.:
Charles E. Sellier, Jr.
as opposed to:
Charles E. Sellier, Jr.
the software will error out as follows:
# insert into pubs(pub_title) values('xxx');
# update pubs set pub_title='Hangar 18' where pub_id=296549
# update pubs set pub_tag='HNGRTCNRMN1980' where pub_id=296549
# update pubs set pub_year='1980-09-00' where pub_id=296549
# update pubs set pub_pages='166' where pub_id=296549
# update pubs set pub_ptype='pb' where pub_id=296549
# update pubs set pub_ctype='NOVEL' where pub_id=296549
# update pubs set pub_isbn='0553144731' where pub_id=296549
# update pubs set pub_price='$2.25' where pub_id=296549
# update pubs set note_id='183218' where pub_id=296549
# select publisher_id from publishers where publisher_name='Bantam';
# update pubs set publisher_id='25' where pub_id=296549
# insert into pub_authors(pub_id, author_id) values('296549', '123151');
# insert into authors(author_canonical) values('Charles E. Sellier, Jr.'); --> -->
<type 'exceptions.IndexError'> Python 2.5: /usr/bin/python
Sun Aug 23 13:42:41 2009
A problem occurred in a Python script. Here is the sequence of function calls leading up to the error, in the order they occurred.
/var/www/cgi-bin/mod/pa_new.cgi in ()
483 print "<hr>"
484
485 Record = DoSubmission(db, submission)
486
487 print "<hr>"
Record undefined, DoSubmission = <function DoSubmission at 0x89b0e64>, db = <_mysql.connection open to 'localhost' at 88e9b3c>, submission = 1212947
/var/www/cgi-bin/mod/pa_new.cgi in DoSubmission(db=<_mysql.connection open to 'localhost' at 88e9b3c>, submission=1212947)
369 for author in authors:
370 data = XMLunescape(author.firstChild.data.encode('iso-8859-1'))
371 addPubAuthor(data, Record)
372
373 ##########################################################
global addPubAuthor = <function addPubAuthor at 0x89b0d84>, data = 'Charles E. Sellier, Jr.', Record = 296549L
/var/www/cgi-bin/mod/pa_new.cgi in addPubAuthor(author='Charles E. Sellier, Jr.', pub_id=296549L)
144 author_id = record[0][0]
145 else:
146 author_id = insertAuthorCanonical(author)
147
148 ##############################################
author_id undefined, global insertAuthorCanonical = <function insertAuthorCanonical at 0x89b0614>, author = 'Charles E. Sellier, Jr.'
/var/www/cgi-bin/mod/common.py in insertAuthorCanonical(author='Charles E. Sellier, Jr.')
281 if (lastname == 'Jr.') or (lastname == 'Sr.') or (lastname == 'M.D.') or (lastname == 'Ph.D.') or (lastname == 'II') or (lastname == 'III') or (lastname == 'IV'):
282 lastname = fields[len(fields)-2]
283 if lastname[len(lastname)-1] == ',':
284 lastname = lastname[0:len(lastname)-1]
285 update = "update authors set author_lastname='%s' where author_id='%d'" % (db.escape_string(lastname), author_id)
lastname = '', builtin len = <built-in function len>
<type 'exceptions.IndexError'>: string index out of range
Anonymous
Fixed in common/titleClass.py 1.4, common/pubClass.py 1.7 . Implemented in r2009-44.