Returns the string, and true if it was quoted.
(text)
| 202 | |
| 203 | |
| 204 | def _unquote_unescape(text): |
| 205 | """Returns the string, and true if it was quoted.""" |
| 206 | if not text: |
| 207 | return text, False |
| 208 | quoted = False |
| 209 | text = text.strip() |
| 210 | if text[0] == '"': |
| 211 | if len(text) == 1 or text[-1] != '"': |
| 212 | raise ValueError("missing close quote") |
| 213 | text = text[1:-1] |
| 214 | quoted = True |
| 215 | if "\\" in text: |
| 216 | text = _replace_escaping(text) |
| 217 | return text, quoted |
| 218 | |
| 219 | |
| 220 | # If we have multiple values only consider the first |
no test coverage detected