summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris McDonough <chrism@agendaless.com>2009-06-24 05:37:10 +0000
committerChris McDonough <chrism@agendaless.com>2009-06-24 05:37:10 +0000
commit67ed638711502b889c384c10fd31723f34b15932 (patch)
tree9535af2d10b523e405ec6a71b432e09862be53b1
parent87268814ece91aa2394feec47d8c95863e041c5a (diff)
downloadpyramid-67ed638711502b889c384c10fd31723f34b15932.tar.gz
pyramid-67ed638711502b889c384c10fd31723f34b15932.tar.bz2
pyramid-67ed638711502b889c384c10fd31723f34b15932.zip
Speculative fix for symptom similar to:
http://code.google.com/p/google-app-engine-django/issues/detail?id=11 (reported by webmaven)
-rw-r--r--repoze/bfg/threadlocal.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/repoze/bfg/threadlocal.py b/repoze/bfg/threadlocal.py
index a300f13b7..5039ec92f 100644
--- a/repoze/bfg/threadlocal.py
+++ b/repoze/bfg/threadlocal.py
@@ -2,7 +2,12 @@ import threading
from zope.component import getGlobalSiteManager
class ThreadLocalManager(threading.local):
- def __init__(self, default):
+ def __init__(self, default=None):
+ # http://code.google.com/p/google-app-engine-django/issues/detail?id=119
+ # we *must* use a keword argument for ``default`` here instead
+ # of a positional argument to work around a bug in the
+ # implementation of _threading_local.local in Python, which is
+ # used by GAE instead of _thread.local
self.stack = []
self.default = default
@@ -30,7 +35,7 @@ def defaults():
defaults['registry'] = gsm
return defaults
-manager = ThreadLocalManager(defaults)
+manager = ThreadLocalManager(default=defaults)
## **The below function ``get_current*`` functions are special. They
## are not part of the official BFG API, however, they're guaranteed