In [1]: from pymongo import MongoClient
In [2]: m = MongoClient()
In [3]: mypass = ''
In [4]: isinstance(mypass, basestring)
Out [4]: True
In [5]: m.admin.authenticate('myuser', mypass)
....
....
File "/usr/local/lib/python2.7/dist-packages/pymongo/auth.py", line 215, in authenticate_mongo_cr
key = auth_key(nonce, username, password)
File "/usr/local/lib/python2.7/dist-packages/pymongo/auth.py", line 76, in _auth_key
digest = _password_digest(username, password)
File "/usr/local/lib/python2.7/dist-packages/pymongo/auth.py", line 60, in _password_digest
"of %s" % (basestring.__name,))
TypeError: password must be an instance of basestring