EditBug:10087 Python error on merge author

From ISFDB
Jump to navigation Jump to search

When I approved submission 197751, which gave me this display:

Column 		KeepId [597] 				DropId [20567]
Canonical 	Richard Parks 				B. Richard Parks
Legalname 	Parks, Richard 				-
Birthplace 	Newton, MS, USA 			-
Birthdate 	1955-06-15 				-
Deathdate 	- 					-
Emails 		brp1@sff.net				-
Webpages 	http://www.dm.net/~richard-parks/ 	-
Wikipedia 	- 					-
Imdb 	- 						-
Imdb 	- 						-

I got the following error:

update authors set author_canonical='B. Richard Parks' where author_id='597' --> -->


TypeError Python 2.4.2: /usr/local/bin/python Mon Jan 15 15:33:10 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/mod/aa_merge.cgi
 169         merge = doc.getElementsByTagName('AuthorMerge')
 170         if merge:
 171                 AuthorMerge(db, recno, doc)
 172 
 173         submitter = GetElementValue(merge, 'Submitter')

AuthorMerge = <function AuthorMerge>, db = <_mysql.connection open to 'localhost' at 82adc0c>, recno = '197751', doc = <xml.dom.minidom.Document instance>

/www/isfdb.tamu.edu/root/cgi-bin/mod/aa_merge.cgi in AuthorMerge(db=<_mysql.connection open to 'localhost' at 82adc0c>, recno='197751', doc=<xml.dom.minidom.Document instance>)
  98         id = GetElementValue(merge, 'Legalname')
  99         if id and id != KeepId:
 100                 moveAuthorColumn(db, 'author_legalname', KeepId, DropId)
 101 
 102         id = GetElementValue(merge, 'Birthplace')

global moveAuthorColumn = <function moveAuthorColumn>, db = <_mysql.connection open to 'localhost' at 82adc0c>, KeepId = '597', DropId = '20567'

/www/isfdb.tamu.edu/root/cgi-bin/mod/aa_merge.cgi in moveAuthorColumn(db=<_mysql.connection open to 'localhost' at 82adc0c>, column='author_legalname', keep='597', drop='20567')
  66         record = result.fetch_row()
  67         value = record[0][0]
  68         update = "update authors set %s='%s' where author_id='%d'" % (column, db.escape_string(value), int(keep))

69 print "

  • ", update 70 db.query(update) update undefined, column = 'author_legalname', db = <_mysql.connection open to 'localhost' at 82adc0c>, db.escape_string = <built-in method escape_string of Connection object>, value = None, builtin int = <type 'int'>, keep = '597' TypeError: escape_string() argument 1 must be string or read-only buffer, not None args = ('escape_string() argument 1 must be string or read-only buffer, not None',)