Validate the appname option.
(option: str, value: Any)
| 555 | |
| 556 | |
| 557 | def validate_appname_or_none(option: str, value: Any) -> Optional[str]: |
| 558 | """Validate the appname option.""" |
| 559 | if value is None: |
| 560 | return value |
| 561 | validate_string(option, value) |
| 562 | # We need length in bytes, so encode utf8 first. |
| 563 | if len(value.encode("utf-8")) > 128: |
| 564 | raise ValueError(f"{option} must be <= 128 bytes") |
| 565 | return value |
| 566 | |
| 567 | |
| 568 | def validate_driver_or_none(option: Any, value: Any) -> Optional[DriverInfo]: |
nothing calls this directly
no test coverage detected