| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
ipaddress.ip_{address,network,interface} helper functions (GH-30642)
`IPv*Network` and `IPv*Interface` constructors accept a 2-tuple of
(address description, netmask) as the address parameter.
When the tuple-based address is used errors are not propagated
correctly through the `ipaddress.ip_*` helper because of the %-formatting now expecting several arguments:
In [7]: ipaddress.ip_network(("192.168.100.0", "fooo"))
...
TypeError: not all arguments converted during string formatting
Compared to:
In [8]: ipaddress.IPv4Network(("192.168.100.0", "foo"))
...
NetmaskValueError: 'foo' is not a valid netmask
Use an f-string to make sure the error is always properly formatted.
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
(cherry picked from commit 52dc9c3066bcdc67a7a45d41cf158ecb1434d5f3)
Co-authored-by: Thomas Cellerier <thomascellerier@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
(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)
|
|
|
|
|
| |
(cherry picked from commit 52f98424a55e14f05dfa7483cc0faf634a61c9ff)
Co-authored-by: Eric L. Frederich <eric.frederich@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
| |
(GH-21033)
The __hash__() methods of classes IPv4Interface and IPv6Interface had issue
of generating constant hash values of 32 and 128 respectively causing hash collisions.
The fix uses the hash() function to generate hash values for the objects
instead of XOR operation
(cherry picked from commit b30ee26e366bf509b7538d79bfec6c6d38d53f28)
Co-authored-by: Ravi Teja P <rvteja92@gmail.com>
|
|
|
| |
These were added by mistake (see https://bugs.python.org/issue39481#msg366288).
|
| |
|
|
|
|
|
|
| |
networks (GH-18757)
The `.hosts()` method now returns the single address present in a /32 or /128 network.
|
|
|
|
| |
deprecation warning (GH-13195)
|
|
|
| |
Automerge-Triggered-By: @asvetlov
|
|
|
|
| |
Also cache the compiled RE for parsing the format specifier.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* bits method and test_bits
* Cleaned up assert string
* blurb
* added docstring
* Faster method, per Eric Smith
* redoing as __format__
* added ipv6 method
* test cases and cleanup
* updated news
* cleanup and NEWS.d
* cleaned up old NEWS
* removed cut and paste leftover
* one more cleanup
* moved to regexp, moved away from v4- and v6-specific versions of __format__
* More cleanup, added ipv6 test cases
* more cleanup
* more cleanup
* cleanup
* cleanup
* cleanup per review, part 1
* addressed review comments around help string and regexp matching
* wrapped v6 test strings. contiguous integers: break at 72char. with underscores: break so that it looks clean.
* 's' and '' tests for pv4 and ipv6
* whitespace cleanup
* Remove trailing whitespace
* Remove more trailing whitespace
* Remove an excess blank line
|
|
|
|
| |
(GH-13298)
|
|
|
| |
make a compare in bit-operation manner.
|
|
|
|
|
|
|
| |
IPv4Interface and IPv6Interface did not has netmask and hostmask
attributes when its argument is bytes or int.
This commit extracts method for constructors of Network and Interface,
and ensure Interface class always provides them.
|
|
|
|
| |
* cached_property is more efficient than hand crafted cache.
* In IPv[46]Network, `self.network.prefixlen` is same to `self._prefixlen`.
|
| |
|
|
|
|
|
|
|
|
|
| |
Stop rejecting IPv4 octets with leading zeroes as ambiguously octal.
Plenty of other tools generate decimal IPv4 octets with leading zeroes,
so keeping this check hurts interoperability.
Patch by Joel Croteau.
|
|
|
|
|
|
| |
The result of host() was not empty when the network is constructed by a tuple containing an
integer mask and only 1 bit left for addresses.
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
the original logic was just comparing the network address
but this is wrong because if the network address is equal then
we need to compare the ip address for breaking the tie
add more ip_interface comparison tests
|
|
|
|
| |
Patch by Gareth Rees.
|
|
|
|
|
|
| |
It was documented since 07a5610bae9d.
Initial patch by Roger Luethi.
|
|
|
|
|
| |
when resulting prefix length is equal to maximal prefix length.
Based on patch by Xiang Zhang.
|
|
|
|
| |
with specified exception type. Original patch by Ramchandra Apte.
|
| |
|
|\ |
|
| | |
|
| |
| |
| |
| | |
duplicated addresses and simplify the code.
|
| |
| |
| |
| | |
portable representation.
|
| |
| |
| |
| | |
when there are many non-consecutive addresses.
|
| |
| |
| |
| | |
generators.
|
| | |
|
|\ \
| |/
| |
| | |
Patch by Févry Thibault.
|
| |
| |
| |
| | |
Patch by Févry Thibault.
|
| |
| |
| |
| | |
Charles-François)
|
| |
| |
| |
| | |
IPv6Address) such as .is_private or .is_multicast.
|
| | |
|
| |
| |
| |
| | |
ipaddress.{IPv4Network,IPv6Network}.subnets().
|
| |
| |
| |
| | |
ipaddress.IPv6Network.
|
| |
| |
| |
| | |
(address, netmask) tuple argument, so as to easily construct network objects from existing addresses.
|
|/ |
|
|
|
|
| |
in ipaddress.
|
|\ |
|
| | |
|
| | |
|
| |
| |
| |
| | |
100.64.0.0/10
|
|/ |
|
| |
|
| |
|