UnboundLocalError | Python 3.6.9: /usr/bin/python3 Sun Jun 26 18:49:09 2022 |
A problem occurred in a Python script. Here is the sequence of function calls leading up to the error, in the order they occurred.
/home/cryan/secure_html/generallistall.py in <module>() |
57 |
58 myConnection = mysql.connector.connect( host=hostname, user=username, passwd=password, db=database ) |
=> 59 databasedata,category,pagepromo,headerimage = doQuery( myConnection ) |
60 myConnection.close() |
61 |
databasedata undefined, category undefined, pagepromo undefined, headerimage undefined, doQuery = <function doQuery>, myConnection = <mysql.connector.connection_cext.CMySQLConnection object> |
/home/cryan/secure_html/generallistall.py in doQuery(conn=<mysql.connector.connection_cext.CMySQLConnection object>) |
53 promourl = row[10] |
54 headerimage = row[10] |
=> 55 return content,category,pagepromo,headerimage; |
56 |
57 |
content = '', category undefined, pagepromo undefined, headerimage undefined |
UnboundLocalError: local variable 'category' referenced before assignment
args =
("local variable 'category' referenced before assignment",)
with_traceback =
<built-in method with_traceback of UnboundLocalError object>