2011-08-10 2 views
2

uWSGI (0.9.8)가있는 Ubuntu 10.10 (64 비트)에서 Django 1.3 + Python 2.6을 실행하고 있습니다. 그러나 때로는 uwsgi.log에 'getattr', 'isinstance'가 정의되어 있지 않은 이상한 로그를 찾을 수 있습니다. 하지만 파이썬의 빌트인 함수가 아닌가? 왜 장고가 그들을 찾을 수 없습니까? 이것은 uwsgi 서버가 다시 시작할 때 트래픽이 적을 때 자주 발생하지 않으며 트래픽이 커서 짧은 시간 동안 서버가 실행될 때 자주 나타납니다.uWSGI로 작업 할 때 Django의 내장 Python 함수에 대한 NameError

장고 응용 프로그램에는 아무 문제가 없지만 이것이 장고, uWSGI 또는 파이썬 2.6의 버그인지 확실하지 않습니다.

업데이트 : uWSGI의 최신 버전에는이 기능이 다시없는 것으로 보입니다.

상세 로그 :

Error in sys.excepthook: 
Traceback (most recent call last): 
    File "/usr/lib/python2.6/dist-packages/apport_python_hook.py", line 48, in apport_excepthook 
    if not enabled(): 
    File "/usr/lib/python2.6/dist-packages/apport_python_hook.py", line 24, in enabled 
    return re.search('^\s*enabled\s*=\s*0\s*$', conf, re.M) is None 
    File "/usr/lib/python2.6/re.py", line 142, in search 
    return _compile(pattern, flags).search(string) 
    File "/usr/lib/python2.6/re.py", line 236, in _compile 
    if isinstance(pattern, _pattern_type): 
NameError: global name 'isinstance' is not defined 

Original exception was: 
Traceback (most recent call last): 
    File "/usr/local/lib/python2.6/dist- 
packages/django/core/handlers/wsgi.py", line 258, in __call__ 
    set_script_prefix(base.get_script_name(environ)) 
    File "/usr/local/lib/python2.6/dist- 
packages/django/core/handlers/base.py", line 239, in get_script_name 
    if settings.FORCE_SCRIPT_NAME is not None: 
    File "/usr/local/lib/python2.6/dist- 
packages/django/utils/functional.py", line 277, in __getattr__ 
    return getattr(self._wrapped, name) 
NameError: global name 'getattr' is not defined Traceback (most recent call last): 
    File "/usr/local/lib/python2.6/dist- 
packages/django/core/handlers/wsgi.py", line 258, in __call__ 
    set_script_prefix(base.get_script_name(environ)) 
    File "/usr/local/lib/python2.6/dist- 
packages/django/core/handlers/base.py", line 252, in get_script_name 
    return force_unicode(environ.get('SCRIPT_NAME', u'')) 
    File "/usr/local/lib/python2.6/dist-packages/django/utils/encoding.py", 
line 64, in force_unicode 
    if isinstance(s, unicode): 
NameError: global name 'isinstance' is not defined Error in sys.excepthook: 
Traceback (most recent call last): 
    File "/usr/lib/python2.6/dist-packages/apport_python_hook.py", line 48, in apport_excepthook 
    if not enabled(): 
    File "/usr/lib/python2.6/dist-packages/apport_python_hook.py", line 24, in enabled 
    return re.search('^\s*enabled\s*=\s*0\s*$', conf, re.M) is None 
    File "/usr/lib/python2.6/re.py", line 142, in search 
    return _compile(pattern, flags).search(string) 
    File "/usr/lib/python2.6/re.py", line 236, in _compile 
    if isinstance(pattern, _pattern_type): 
NameError: global name 'isinstance' is not defined 

답변

1

최신 팁 사용해 볼 수 있습니까? 0.9.9-dev에서 수정해야하는 참조 계산 버그와 같습니다.

문제가 해결되었다는 것을 확인할 수 있으면이 수정본 만 적용된 업데이트 된 릴리즈가 출시됩니다.

신고 해 주셔서 감사합니다.

+0

방금 ​​gevent로 옮겼습니다. 곧 시도하겠습니다. 감사합니다. –

+0

최신 버전에는 아무 문제가없는 것으로 보입니다. –

관련 문제