Django exception beating me doesn't know how to debug it

I recently upgraded to python2.7 and django1.3, and since then

Unhandled exception in thread started by <bound method Command.inner_run of <django.core.management.commands.runserver.Command object at 0x109c57490>>
Traceback (most recent call last):
    File "/Users/ApPeL/.virtualenvs/myhunt/lib/python2.7/site-packages/django/core/management/commands/runserver.py", line 88, in inner_run
        self.validate(display_num_errors=True)
    File "/Users/ApPeL/.virtualenvs/myhunt/lib/python2.7/site-packages/django/core/management/base.py", line 249, in validate
        num_errors = get_validation_errors(s, app)
    File "/Users/ApPeL/.virtualenvs/myhunt/lib/python2.7/site-packages/django/core/management/validation.py", line 36, in get_validation_errors
        for (app_name, error) in get_app_errors().items():
    File "/Users/ApPeL/.virtualenvs/myhunt/lib/python2.7/site-packages/django/db/models/loading.py", line 146, in get_app_errors
        self._populate()
    File "/Users/ApPeL/.virtualenvs/myhunt/lib/python2.7/site-packages/django/db/models/loading.py", line 67, in _populate
        self.write_lock.release()
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", line 137, in release
        raise RuntimeError("cannot release un-acquired lock")
    RuntimeError: cannot release un-acquired lock

Your help will be greatly appreciated.

+5
source share
1 answer

Usually the first recommendation is to apply the latest gentent or greenlet updates or whatever you use related to streams. The implementation of threading.Thread.start has been changed between Python 2.6 and 2.7. There are many recipes for starting green ... or green ... with Django. Try reading the latest for Python 2.7. and send the link that caused the problem.

Debugging: manage.py, .. stderr:

import threading
setattr(threading, '__debug__', True)

verbose django/db/loading.py 39, , .

-        write_lock = threading.RLock(),
+        write_lock = threading.RLock(verbose=True),

. - :

$ python manage.py runserver --noreload
Validating models...

MainThread: <_RLock owner='MainThread' count=1>.acquire(1): initial success
MainThread: <_RLock owner=None count=0>.release(): final release

:
 count=1 acquire(1) -
 owner=None count=0>.release() -

$ python manage.py runserver
Validating models...

Dummy-1: <_RLock owner=-1222960272 count=1>.acquire(1): initial success
Dummy-1: <_RLock owner=None count=0>.release(): final release

. . "Dummy-1" - . , / , . .

+1

All Articles