The changes in PyMongo 2.7 to better support python sub-interpreters (mainly mod_wsgi) with PyMongo's C extensions interact poorly with python types from third party libraries that have broken implementations of __getattr__. In these cases a call to PyObject_HasAttrString will always return 1, with PyObject_GetAttrString returning an unexpected value. _cbson already handles the unexpected value, but in a way that makes it impossible to encode types that can still be encoded, regardless of their broken __getattr__ implementation. This isn't technically a bug in PyMongo, but we should work around it anyway.
This issue was reported in https://github.com/mongodb/mongo-python-driver/pull/234.
Thanks to Sergey Azovskov for the report and patch.