2011-08-10 4 views
2

私はuWSGI(0.9.8)を使用してUbuntu 10.10(64ビット)でDjango 1.3 + Python 2.6を実行しています。 しかし、ときどき私は 'getattr'、 'isinstance'が定義されていないことを報告するuwsgi.logに奇妙なログを見つけることができます。しかし、Pythonの組み込み関数ではありませんか?なぜDjangoはそれらを見つけることができませんか?これは、uwsgiサーバーが再起動したときにトラフィックが少なくなったときに頻繁に発生することはなく、トラフィックが大きく、サーバーが短期間実行されたときに頻繁に表示されます。uWSGIで作業するときにDjangoに組み込まれたPython関数のNameError

私のdjangoアプリケーションに何も問題はないと確信していますが、これがDjango、uWSGI、またはPython 2.6のバグかどうかはわかりません。

UPDATE: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

最新バージョンでは何も間違っていないようでした。 –

関連する問題