MCPcopy Index your code
hub / github.com/python/cpython / unquote

Function unquote

Lib/email/utils.py:357–364  ·  view source on GitHub ↗

Remove quotes from a string.

(str)

Source from the content-addressed store, hash-verified

355
356# rfc822.unquote() doesn't properly de-backslash-ify in Python pre-2.3.
357def unquote(str):
358 """Remove quotes from a string."""
359 if len(str) > 1:
360 if str.startswith('"') and str.endswith('"'):
361 return str[1:-1].replace('\\\\', '\\').replace('\\"', '"')
362 if str.startswith('<') and str.endswith('>'):
363 return str[1:-1]
364 return str
365
366
367

Callers 2

decode_paramsFunction · 0.70
collapse_rfc2231_valueFunction · 0.70

Calls 3

startswithMethod · 0.45
endswithMethod · 0.45
replaceMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…