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

Method as_lwp_str

Lib/http/cookiejar.py:1873–1887  ·  view source on GitHub ↗

Return cookies as a string of "\\n"-separated "Set-Cookie3" headers. ignore_discard and ignore_expires: see docstring for FileCookieJar.save

(self, ignore_discard=True, ignore_expires=True)

Source from the content-addressed store, hash-verified

1871 """
1872
1873 def as_lwp_str(self, ignore_discard=True, ignore_expires=True):
1874 """Return cookies as a string of "\\n"-separated "Set-Cookie3" headers.
1875
1876 ignore_discard and ignore_expires: see docstring for FileCookieJar.save
1877
1878 """
1879 now = time.time()
1880 r = []
1881 for cookie in self:
1882 if not ignore_discard and cookie.discard:
1883 continue
1884 if not ignore_expires and cookie.is_expired(now):
1885 continue
1886 r.append("Set-Cookie3: %s" % lwp_cookie_str(cookie))
1887 return "\n".join(r+[""])
1888
1889 def save(self, filename=None, ignore_discard=False, ignore_expires=False):
1890 if filename is None:

Callers 1

saveMethod · 0.95

Calls 5

lwp_cookie_strFunction · 0.85
is_expiredMethod · 0.80
timeMethod · 0.45
appendMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected