diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2021-05-02 13:49:03 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-02 13:49:03 (GMT) |
commit | 5374fbc31446364bf5f12e5ab88c5493c35eaf04 (patch) | |
tree | df1f73273aafe1a0e0da4358cb15da64c66bf71c /Doc/whatsnew | |
parent | cf6a79644c227159b8b5a44055650266d578b9f6 (diff) | |
download | cpython-5374fbc31446364bf5f12e5ab88c5493c35eaf04.zip cpython-5374fbc31446364bf5f12e5ab88c5493c35eaf04.tar.gz cpython-5374fbc31446364bf5f12e5ab88c5493c35eaf04.tar.bz2 |
bpo-36384: Leading zeros in IPv4 addresses are no longer tolerated (GH-25099) (GH-25815)
Reverts commit e653d4d8e820a7a004ad399530af0135b45db27a and makes
parsing even more strict. Like socket.inet_pton() any leading zero
is now treated as invalid input.
Signed-off-by: Christian Heimes <christian@python.org>
Co-authored-by: Ćukasz Langa <lukasz@langa.pl>
(cherry picked from commit 60ce8f0be6354ad565393ab449d8de5d713f35bc)
Diffstat (limited to 'Doc/whatsnew')
-rw-r--r-- | Doc/whatsnew/3.9.rst | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/Doc/whatsnew/3.9.rst b/Doc/whatsnew/3.9.rst index 6ef0d2a..cb492e4 100644 --- a/Doc/whatsnew/3.9.rst +++ b/Doc/whatsnew/3.9.rst @@ -537,6 +537,10 @@ Scoped IPv6 addresses can be parsed using :class:`ipaddress.IPv6Address`. If present, scope zone ID is available through the :attr:`~ipaddress.IPv6Address.scope_id` attribute. (Contributed by Oleksandr Pavliuk in :issue:`34788`.) +Starting with Python 3.9.5 the :mod:`ipaddress` module no longer +accepts any leading zeros in IPv4 address strings. +(Contributed by Christian Heimes in :issue:`36384`). + math ---- @@ -1114,6 +1118,14 @@ Changes in the Python API compatible classes that don't inherit from those mentioned types. (Contributed by Roger Aiudi in :issue:`34775`). +* Starting with Python 3.9.5 the :mod:`ipaddress` module no longer + accepts any leading zeros in IPv4 address strings. Leading zeros are + ambiguous and interpreted as octal notation by some libraries. For example + the legacy function :func:`socket.inet_aton` treats leading zeros as octal + notatation. glibc implementation of modern :func:`~socket.inet_pton` does + not accept any leading zeros. + (Contributed by Christian Heimes in :issue:`36384`). + * :func:`codecs.lookup` now normalizes the encoding name the same way as :func:`encodings.normalize_encoding`, except that :func:`codecs.lookup` also converts the name to lower case. For example, ``"latex+latin1"`` encoding |