uWSGI (0.9.8) を使用して Ubuntu 10.10 (64 ビット) で Django 1.3 + Python 2.6 を実行しています。ただし、時々、uwsgi.log に奇妙なログが見つかり、「getattr」、「isinstance」が定義されていないことが報告されます。しかし、それらは Python の組み込み関数ではありませんか? Django がそれらを見つけられないのはなぜですか? これは、uwsgi サーバーの再起動時にトラフィックが少ない場合にはあまり発生せず、トラフィックが大きく、サーバーが短時間実行されている場合に頻繁に発生します。
私の django アプリケーションには何の問題もないと確信していますが、これが Django のバグなのか、uWSGI なのか、Python 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