Helper method for split_options which creates the options dict. Also handles the creation of a list for the URI tag_sets/ readpreferencetags portion, and the use of a unicode options string.
(opts: str, delim: Optional[str])
| 229 | |
| 230 | |
| 231 | def _parse_options(opts: str, delim: Optional[str]) -> _CaseInsensitiveDictionary: |
| 232 | """Helper method for split_options which creates the options dict. |
| 233 | Also handles the creation of a list for the URI tag_sets/ |
| 234 | readpreferencetags portion, and the use of a unicode options string. |
| 235 | """ |
| 236 | options = _CaseInsensitiveDictionary() |
| 237 | for uriopt in opts.split(delim): |
| 238 | key, value = uriopt.split("=") |
| 239 | if key.lower() == "readpreferencetags": |
| 240 | options.setdefault(key, []).append(value) |
| 241 | else: |
| 242 | if key in options: |
| 243 | warnings.warn(f"Duplicate URI option '{key}'.", stacklevel=2) |
| 244 | if key.lower() == "authmechanismproperties": |
| 245 | val = value |
| 246 | else: |
| 247 | val = unquote_plus(value) |
| 248 | options[key] = val |
| 249 | |
| 250 | return options |
| 251 | |
| 252 | |
| 253 | def _handle_security_options(options: _CaseInsensitiveDictionary) -> _CaseInsensitiveDictionary: |
no test coverage detected