This regression was added in PYTHON-1106.
PyMongo 3.2:
>>> r = RawBSONDocument(BSON.encode({})) >>> r['f'] Traceback (most recent call last): File "<stdin>", line 1, in <module> File "bson/raw_bson.py", line 77, in __getitem__ return self.__inflated[item] KeyError: 'f'
PyMongo 3.4-3.7:
>>> from bson.raw_bson import RawBSONDocument >>> r = RawBSONDocument(BSON.encode({})) >>> r['f'] Traceback (most recent call last): File "<stdin>", line 1, in <module> File "bson/raw_bson.py", line 83, in __getitem__ return self.__inflated[item] File "bson/raw_bson.py", line 79, in __inflated raise InvalidBSON('bad object or element length') bson.errors.InvalidBSON: bad object or element length
- is related to
-
PYTHON-1800 InsertManyResult with RawBSONDocument has empty inserted_id array
- Closed