0
有一個similar question,但在我今天發現的特定情況下沒有應答。UnboundLocalError:分配前引用的本地變量'full_path',同時syncdb
我在openSUSE上運行,並且在執行syncdb時出現了這個神祕的錯誤。我發佈了我的調查結果,以幫助處於類似情況的其他人。
> python manage.py syncdb
Creating tables ...
Installing custom SQL ...
Installing indexes ...
Traceback (most recent call last):
File "manage.py", line 14, in <module>
execute_manager(settings)
File "/usr/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 459, in execute_manager
utility.execute()
File "/usr/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 382, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/local/lib/python2.7/site-packages/django/core/management/base.py", line 196, in run_from_argv
self.execute(*args, **options.__dict__)
File "/usr/local/lib/python2.7/site-packages/django/core/management/base.py", line 232, in execute
output = self.handle(*args, **options)
File "/usr/local/lib/python2.7/site-packages/django/core/management/base.py", line 371, in handle
return self.handle_noargs(**options)
File "/usr/local/lib/python2.7/site-packages/django/core/management/commands/syncdb.py", line 164, in handle_noargs
call_command('loaddata', 'initial_data', verbosity=verbosity, database=db)
File "/usr/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 150, in call_command
return klass.execute(*args, **defaults)
File "/usr/local/lib/python2.7/site-packages/django/core/management/base.py", line 232, in execute
output = self.handle(*args, **options)
File "/usr/local/lib/python2.7/site-packages/django/core/management/commands/loaddata.py", line 239, in handle
(full_path, ''.join(traceback.format_exception(sys.exc_type,
UnboundLocalError: local variable 'full_path' referenced before assignment