bpo-41521: Replace whitelist/blacklist with allowlist/denylist (GH-21822)
Automerge-Triggered-By: @tiran
diff --git a/Lib/ipaddress.py b/Lib/ipaddress.py
index bc662c4..160b16d 100644
--- a/Lib/ipaddress.py
+++ b/Lib/ipaddress.py
@@ -1214,7 +1214,7 @@
"""
if not octet_str:
raise ValueError("Empty octet not permitted")
- # Whitelist the characters, since int() allows a lot of bizarre stuff.
+ # Reject non-ASCII digits.
if not (octet_str.isascii() and octet_str.isdigit()):
msg = "Only decimal digits permitted in %r"
raise ValueError(msg % octet_str)
@@ -1719,7 +1719,7 @@
[0..FFFF].
"""
- # Whitelist the characters, since int() allows a lot of bizarre stuff.
+ # Reject non-ASCII digits.
if not cls._HEX_DIGITS.issuperset(hextet_str):
raise ValueError("Only hex digits permitted in %r" % hextet_str)
# We do the length check second, since the invalid character error