Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions bson/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -349,8 +349,8 @@ def _element_to_bson(key, value, check_keys, uuid_subtype):
if check_keys:
if key.startswith("$"):
raise InvalidDocument("key %r must not start with '$'" % key)
if "." in key:
raise InvalidDocument("key %r must not contain '.'" % key)
# if "." in key:
# raise InvalidDocument("key %r must not contain '.'" % key)

name = _make_c_string(key, True)
if isinstance(value, float):
Expand Down
4 changes: 2 additions & 2 deletions bson/_cbsonmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -896,7 +896,7 @@ static int check_key_name(const char* name,
Py_DECREF(InvalidDocument);
return 0;
}
for (i = 0; i < name_length; i++) {
/* for (i = 0; i < name_length; i++) {
if (name[i] == '.') {
PyObject* InvalidDocument = _error("InvalidDocument");
#if PY_MAJOR_VERSION >= 3
Expand All @@ -910,7 +910,7 @@ static int check_key_name(const char* name,
Py_DECREF(InvalidDocument);
return 0;
}
}
} */
return 1;
}

Expand Down