john-kurkowski / tldextract

Accurately separates a URL’s subdomain, domain, and public suffix, using the Public Suffix List (PSL).
BSD 3-Clause "New" or "Revised" License
1.81k stars 211 forks source link

Accept only 4 decimal octet IPv4 addresses. Support IPv4 addresses with unicode dots. #292

Closed elliotwutingfeng closed 1 year ago

elliotwutingfeng commented 1 year ago

Changes

ipaddress.IPv4Address was not used as fallback because it is 5 times slower than regex, and its behavior is inconsistent across Python versions 3.8 and 3.9 (w.r.t. recognition of leading zeroes). For example, on Raspberry Pi OS Bullseye, the latest Python version is 3.9.2-3, which allows leading zeroes. To update to the latest patch version of Python 3.9, one has to manually install from source.

john-kurkowski commented 1 year ago

Thank you!