Fix for randomely ocurring bug
The bug and it's fix are described by the first comment from Guido
in http://code.google.com/p/googleappengine/issues/detail?id=772.
Patch by: Guido van Rossum
--- a/app/main.py Sat Dec 06 14:44:02 2008 +0000
+++ b/app/main.py Sat Dec 06 14:46:19 2008 +0000
@@ -37,6 +37,8 @@
sys.path.insert(0, os.path.abspath('django.zip'))
+ultimate_sys_path = None
+
# Force Django to reload its settings.
from django.conf import settings
settings._target = None
@@ -61,6 +63,12 @@
def main():
+ global ultimate_sys_path
+ if ultimate_sys_path is None:
+ ultimate_sys_path = list(sys.path)
+ else:
+ sys.path[:] = ultimate_sys_path
+
# Create a Django application for WSGI.
application = django.core.handlers.wsgi.WSGIHandler()