Are objects modified when they are saved in the Configurator registry.settings dictionary?
I am trying to store a Suds SOAP Client in the registry which can be cloned in my view-callables so I can avoid re-parsing that WSDL document. When I am trying to clone the Suds Client that has been stored in the registry, my app is crashing horribly due to a maximum recursion limit reached exception.
Some code:
In my app __init__.py:
def main(global_config, **app_settings):
settings = {}
...
settings['soap_client'] = suds.client.Client('file:///service.wsdl', username='foo', password='bar')
config = Configurator(settings=settings, ...)
return config.make_wsgi_app()
view-callable.py
def view(request):
cloned_soap_client = request.registry.settings['soap_client'].clone() <-- Induces Max. Recursion exception
return cloned_soap_client.service.SomeMethod()
If I drop in to a PDB terminal inside of my application's main() function and try cloneing settings['soap_client'] I do not encounter this recursion limit.
Sure, this is probably an bug with the Suds client, but I'm not sure how toreproduce it outside of my application.