Using python-openid-2.2.1, calling answer(True) on a CheckIDRequest object prints the following deprecation message:
.../openid/server/server.py:974: DeprecationWarning: The "namespace" attribute of CheckIDRequest objects is deprecated. Use "message.getOpenIDNamespace()" instead
self.fields = Message(request.namespace)
The call chain here is:
- answer() creates an OpenIDResponse object, passing self as an argument.
- OpenIDResponse.init() accesses the namespace attribute of its argument.
- CheckIDRequest.namespace is a property that raises the deprecation warning.
Now changing the OpenIDResponse.init() code to call request.message.getOpenIDNamespace() does not seem correct -- there are other OpenIDRequest subclasses that can be passed in that have a namespace attribute but no message attribute.
So perhaps the best solution is to remove the deprecation warning. Deprecation warnings that are printed when the library user only uses non-deprecated APIs reduce the utility of all other warnings.