diff options
| author | Chris McDonough <chrism@agendaless.com> | 2009-06-24 05:37:10 +0000 |
|---|---|---|
| committer | Chris McDonough <chrism@agendaless.com> | 2009-06-24 05:37:10 +0000 |
| commit | 67ed638711502b889c384c10fd31723f34b15932 (patch) | |
| tree | 9535af2d10b523e405ec6a71b432e09862be53b1 | |
| parent | 87268814ece91aa2394feec47d8c95863e041c5a (diff) | |
| download | pyramid-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.py | 9 |
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 |
