MCPcopy Index your code
hub / github.com/mongodb/mongo-python-driver / validate_readable

Function validate_readable

pymongo/common.py:231–239  ·  view source on GitHub ↗

Validates that 'value' is file-like and readable.

(option: str, value: Any)

Source from the content-addressed store, hash-verified

229
230
231def validate_readable(option: str, value: Any) -> Optional[str]:
232 """Validates that 'value' is file-like and readable."""
233 if value is None:
234 return value
235 # First make sure its a string py3.3 open(True, 'r') succeeds
236 # Used in ssl cert checking due to poor ssl module error reporting
237 value = validate_string(option, value)
238 open(value).close()
239 return value
240
241
242def validate_non_negative_integer_or_none(option: str, value: Any) -> Optional[int]:

Callers

nothing calls this directly

Calls 2

validate_stringFunction · 0.85
closeMethod · 0.45

Tested by

no test coverage detected