Using pymongo 2.8 gives the error in the title. Looks like it's due to the recent changes to set_read_preference.