Raises an InvalidWriteError for any keys containing delimiters or that begins with the section header pattern
(self, key)
| 1218 | return self.BOOLEAN_STATES[value.lower()] |
| 1219 | |
| 1220 | def _validate_key_contents(self, key): |
| 1221 | """Raises an InvalidWriteError for any keys containing |
| 1222 | delimiters or that begins with the section header pattern""" |
| 1223 | if re.match(self.SECTCRE, key): |
| 1224 | raise InvalidWriteError( |
| 1225 | f"Cannot write key {key}; begins with section pattern") |
| 1226 | for delim in self._delimiters: |
| 1227 | if delim in key: |
| 1228 | raise InvalidWriteError( |
| 1229 | f"Cannot write key {key}; contains delimiter {delim}") |
| 1230 | |
| 1231 | def _validate_value_types(self, *, section="", option="", value=""): |
| 1232 | """Raises a TypeError for illegal non-string values. |
no test coverage detected