UnboundLocalError | Python 3.9.2: /usr/bin/python3 Thu Mar 28 22:39:59 2024 |
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/read/index.py in <module> |
1464 |
1465 if __name__ == '__main__': |
1466 compressout.init() |
=> 1467 main() |
1468 compressout.done() |
main = <function main> |
/var/www/read/index.py in main() |
1451 if download_flag == 'no': |
1452 if if_none_match(path): |
=> 1453 cat(path, referer) |
1454 else: |
1455 # `download` sets a few headers. |
global cat = <function cat>, path = '/var/www/tridecane/model.png', referer = ('', 'Back') |
/var/www/read/index.py in cat(path='/var/www/tridecane/model.png', referer=('', 'Back')) |
1075 compressout.write_h('X-Robots-Tag: index\n') |
1076 compressout.write_h('\n') |
=> 1077 compressout.write_b(content) |
1078 return |
1079 |
global compressout = <module 'compressout' from '/var/www/compressout.py'>, compressout.write_b = <function write_b>, content undefined |
UnboundLocalError: local variable 'content' referenced before assignment
args =
("local variable 'content' referenced before assignment",)
with_traceback =
<built-in method with_traceback of UnboundLocalError object>