MCPcopy Index your code
hub / github.com/python-websockets/websockets / build_quoted_string

Function build_quoted_string

src/websockets/headers.py:152–162  ·  view source on GitHub ↗

Format ``value`` as a quoted string. This is the reverse of :func:`parse_quoted_string`.

(value: str)

Source from the content-addressed store, hash-verified

150
151
152def build_quoted_string(value: str) -> str:
153 """
154 Format ``value`` as a quoted string.
155
156 This is the reverse of :func:`parse_quoted_string`.
157
158 """
159 match = _quotable_re.fullmatch(value)
160 if match is None:
161 raise ValueError("invalid characters for quoted-string encoding")
162 return '"' + _quote_re.sub(r"\\\1", value) + '"'
163
164
165def parse_list(

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…