(text)
| 166 | ) |
| 167 | |
| 168 | def _escape(text): |
| 169 | m = _controlCharPat.search(text) |
| 170 | if m is not None: |
| 171 | raise ValueError("strings can't contain control characters; " |
| 172 | "use bytes instead") |
| 173 | text = text.replace("\r\n", "\n") # convert DOS line endings |
| 174 | text = text.replace("\r", "\n") # convert Mac line endings |
| 175 | text = text.replace("&", "&") # escape '&' |
| 176 | text = text.replace("<", "<") # escape '<' |
| 177 | text = text.replace(">", ">") # escape '>' |
| 178 | return text |
| 179 | |
| 180 | class _PlistParser: |
| 181 | def __init__(self, dict_type, aware_datetime=False): |
no test coverage detected