MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / quote

Function quote

tools/python-3.11.9-amd64/Lib/email/_parseaddr.py:201–208  ·  view source on GitHub ↗

Prepare string to be used in a quoted string. Turns backslash and double quote characters into quoted pairs. These are the only characters that need to be quoted inside a quoted string. Does not add the surrounding double quotes.

(str)

Source from the content-addressed store, hash-verified

199
200
201def quote(str):
202 """Prepare string to be used in a quoted string.
203
204 Turns backslash and double quote characters into quoted pairs. These
205 are the only characters that need to be quoted inside a quoted string.
206 Does not add the surrounding double quotes.
207 """
208 return str.replace('\\', '\\\\').replace('"', '\\"')
209
210
211class AddrlistClass:

Callers 2

decode_paramsFunction · 0.90
getaddrspecMethod · 0.70

Calls 1

replaceMethod · 0.45

Tested by

no test coverage detected