Make a 'C' string suitable for a BSON key.
(string: str)
| 693 | |
| 694 | |
| 695 | def _make_name(string: str) -> bytes: |
| 696 | """Make a 'C' string suitable for a BSON key.""" |
| 697 | if "\x00" in string: |
| 698 | raise InvalidDocument("BSON keys must not contain a NUL character") |
| 699 | return _utf_8_encode(string)[0] + b"\x00" |
| 700 | |
| 701 | |
| 702 | def _encode_float(name: bytes, value: float, dummy0: Any, dummy1: Any) -> bytes: |
no test coverage detected