Format ``value`` as a quoted string. This is the reverse of :func:`parse_quoted_string`.
(value: str)
| 150 | |
| 151 | |
| 152 | def build_quoted_string(value: str) -> str: |
| 153 | """ |
| 154 | Format ``value`` as a quoted string. |
| 155 | |
| 156 | This is the reverse of :func:`parse_quoted_string`. |
| 157 | |
| 158 | """ |
| 159 | match = _quotable_re.fullmatch(value) |
| 160 | if match is None: |
| 161 | raise ValueError("invalid characters for quoted-string encoding") |
| 162 | return '"' + _quote_re.sub(r"\\\1", value) + '"' |
| 163 | |
| 164 | |
| 165 | def parse_list( |
no outgoing calls
no test coverage detected
searching dependent graphs…