Return a quoted string from ``qs`` string by quoting all non-quoted characters ignoring already quoted characters. This makes the quoted string safer to use in a path. For example:: >>> quote_more("foo") 'foo' >>> quote_more("foo/bar") 'foo%2Fbar' >>> quote_more("
(qs)
| 304 | |
| 305 | |
| 306 | def quote_more(qs): |
| 307 | """ |
| 308 | Return a quoted string from ``qs`` string by quoting all non-quoted characters ignoring already |
| 309 | quoted characters. This makes the quoted string safer to use in a path. |
| 310 | |
| 311 | For example:: |
| 312 | >>> quote_more("foo") |
| 313 | 'foo' |
| 314 | |
| 315 | >>> quote_more("foo/bar") |
| 316 | 'foo%2Fbar' |
| 317 | |
| 318 | >>> quote_more("foo%2Fbar") |
| 319 | 'foo%2Fbar' |
| 320 | """ |
| 321 | if not qs: |
| 322 | return qs |
| 323 | try: |
| 324 | return quote(qs, safe="%") |
| 325 | except Exception as e: |
| 326 | raise Exception(f"Failed to quote_more: {qs!r}") from e |
| 327 | |
| 328 | |
| 329 | def get_core_purl(purl: Union[PackageURL, str]): |
no outgoing calls
no test coverage detected