| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
Sorry, something went wrong.
Documentation build overview420 files changed · + 9 added · ± 411 modified + Added
± Modified |
Sorry, something went wrong.
|
_network_by_offset() bounds new_ip from above only in the prefix > self.prefixlen branch. The other branch falls through to except OverflowError, which only the IPv4 path raises, so on IPv6 the ValueError from _BaseV6._string_from_ip_int() escapes instead of error. Against 7b79473: IPv4Network('255.255.255.0/24').next_network()
-> ValueError: out of address space, cannot make another /24 network
IPv6Network('ffff:ffff:ffff:ffff:ffff:ffff:ffff:0/112').next_network()
-> ValueError: IPv6 address is too large
IPv6Network('ffff::/16').next_network()
-> ValueError: IPv6 address is too large
IPv6Network('ffff:ffff:ffff:ffff:ffff:ffff:ffff:0/112').next_network(next_prefix=120)
-> ValueError: out of address space, cannot make another /120 network
Checking new_ip > self._ALL_ONES next to the existing new_ip < 0 after the branch covers both cases and makes the try/except unnecessary. Same defect as gh-156680; GH-156681 fixes it in next_network() on main. |
Sorry, something went wrong.
Thank you for raising this, I have taken a look and it seems whilst I did write tests for this I was not explicitly checking the error message so didn't notice this happy coincidence. I have now updated the tests to explicitly check the reason/message and refactored the logic as suggested to handle this. It's nice to clean up that try/catch logic too. See commit c6b1d1a |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Following the merge of #24180, it was previously raised that we should add a prev_network method for symmetry, I have now done this as part of this PR so hopefully this completes the entire feature.
FYI for:
@akulakov @merwok @Fidget-Spinner @orsenthil @AA-Turner