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

Function lwp_cookie_str

Lib/http/cookiejar.py:1832–1858  ·  view source on GitHub ↗

Return string representation of Cookie in the LWP cookie file format. Actually, the format is extended a bit -- see module docstring.

(cookie)

Source from the content-addressed store, hash-verified

1830
1831
1832def lwp_cookie_str(cookie):
1833 """Return string representation of Cookie in the LWP cookie file format.
1834
1835 Actually, the format is extended a bit -- see module docstring.
1836
1837 """
1838 h = [(cookie.name, cookie.value),
1839 ("path", cookie.path),
1840 ("domain", cookie.domain)]
1841 if cookie.port is not None: h.append(("port", cookie.port))
1842 if cookie.path_specified: h.append(("path_spec", None))
1843 if cookie.port_specified: h.append(("port_spec", None))
1844 if cookie.domain_initial_dot: h.append(("domain_dot", None))
1845 if cookie.secure: h.append(("secure", None))
1846 if cookie.expires: h.append(("expires",
1847 time2isoz(float(cookie.expires))))
1848 if cookie.discard: h.append(("discard", None))
1849 if cookie.comment: h.append(("comment", cookie.comment))
1850 if cookie.comment_url: h.append(("commenturl", cookie.comment_url))
1851
1852 keys = sorted(cookie._rest.keys())
1853 for k in keys:
1854 h.append((k, str(cookie._rest[k])))
1855
1856 h.append(("version", str(cookie.version)))
1857
1858 return join_header_words([h])
1859
1860class LWPCookieJar(FileCookieJar):
1861 """

Callers 2

test_missing_valueMethod · 0.90
as_lwp_strMethod · 0.85

Calls 5

time2isozFunction · 0.85
strFunction · 0.85
join_header_wordsFunction · 0.85
appendMethod · 0.45
keysMethod · 0.45

Tested by 1

test_missing_valueMethod · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…