Skip to content

Commit 20ae565

Browse files
authored
bpo-41521: Replace denylist with blocklist is http.cookiejar doc (GH-21826)
The http.cookiejar module has is_blocked() and blocked_domains() methods, so "blocklist" term sounds better than "denylist" in this module. Replace also denylisted with denied in test___all__.
1 parent c818b15 commit 20ae565

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

Doc/library/http.cookiejar.rst

+4-4
Original file line numberDiff line numberDiff line change
@@ -462,16 +462,16 @@ receiving cookies. There are also some strictness switches that allow you to
462462
tighten up the rather loose Netscape protocol rules a little bit (at the cost of
463463
blocking some benign cookies).
464464

465-
A domain denylist and allowlist is provided (both off by default). Only domains
466-
not in the denylist and present in the allowlist (if the allowlist is active)
465+
A domain blocklist and allowlist is provided (both off by default). Only domains
466+
not in the blocklist and present in the allowlist (if the allowlist is active)
467467
participate in cookie setting and returning. Use the *blocked_domains*
468468
constructor argument, and :meth:`blocked_domains` and
469469
:meth:`set_blocked_domains` methods (and the corresponding argument and methods
470470
for *allowed_domains*). If you set an allowlist, you can turn it off again by
471471
setting it to :const:`None`.
472472

473473
Domains in block or allow lists that do not start with a dot must equal the
474-
cookie domain to be matched. For example, ``"example.com"`` matches a denylist
474+
cookie domain to be matched. For example, ``"example.com"`` matches a blocklist
475475
entry of ``"example.com"``, but ``"www.example.com"`` does not. Domains that do
476476
start with a dot are matched by more specific domains too. For example, both
477477
``"www.example.com"`` and ``"www.coyote.example.com"`` match ``".example.com"``
@@ -494,7 +494,7 @@ and ``".168.1.2"``, 192.168.1.2 is blocked, but 193.168.1.2 is not.
494494

495495
.. method:: DefaultCookiePolicy.is_blocked(domain)
496496

497-
Return whether *domain* is on the denylist for setting or receiving cookies.
497+
Return whether *domain* is on the blocklist for setting or receiving cookies.
498498

499499

500500
.. method:: DefaultCookiePolicy.allowed_domains()

Lib/test/test___all__.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -85,13 +85,13 @@ def test_all(self):
8585
lib_dir = os.path.dirname(os.path.dirname(__file__))
8686
for path, modname in self.walk_modules(lib_dir, ""):
8787
m = modname
88-
denylisted = False
88+
denied = False
8989
while m:
9090
if m in denylist:
91-
denylisted = True
91+
denied = True
9292
break
9393
m = m.rpartition('.')[0]
94-
if denylisted:
94+
if denied:
9595
continue
9696
if support.verbose:
9797
print(modname)

0 commit comments

Comments
 (0)