-
Type: Bug
-
Resolution: Done
-
Priority: Minor - P4
-
Affects Version/s: None
-
Component/s: None
-
None
import pymongo c = pymongo.Connection() coll = c[u'x\u0000'].test coll.create_index([('x',1)]) Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/lib/python2.7/dist-packages/pymongo/collection.py", line 715, in create_index safe=True) File "/usr/lib/python2.7/dist-packages/pymongo/collection.py", line 312, in insert continue_on_error, self.__uuid_subtype), safe) File "/usr/lib/python2.7/dist-packages/pymongo/connection.py", line 822, in _send_message return self.__check_response_to_last_error(response) File "/usr/lib/python2.7/dist-packages/pymongo/connection.py", line 772, in __check_response_to_last_error raise OperationFailure(error["err"], error["code"]) pymongo.errors.OperationFailure: Invalid BSONObj size: 1937339182 (0x2E737973) first element: em.indexes: ?type=116
"c[u'x\u0000']" should raise pymongo.errors.InvalidName, instead of blowing up the database connection.