Validates that 'value' is file-like and readable.
(option: str, value: Any)
| 229 | |
| 230 | |
| 231 | def 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 | |
| 242 | def validate_non_negative_integer_or_none(option: str, value: Any) -> Optional[int]: |
nothing calls this directly
no test coverage detected