`IPv6Network.next_network()` raises the wrong error when addresses run out
Chưa có ai nhận issue này.
- Ngôn ngữ chính
- Python
- Star
- 77.2k
- Fork
- 36k
- Chỉ số merge pull request
- Chỉ số pull request đang chờ
Mô tả
Bug description:
_BaseNetwork.next_network() guards address-space exhaustion with except OverflowError, which only the IPv4 path raises, so on IPv6 the internal ValueError from _string_from_ip_int() escapes instead.
from ipaddress import IPv4Network, IPv6Network
for net in (IPv4Network('255.255.255.0/24'),
IPv6Network('ffff:ffff:ffff:ffff:ffff:ffff:ffff:0/112')):
try:
net.next_network()
except ValueError as e:
print(f"{net}: {e}")
Output:
255.255.255.0/24: out of address space, cannot make another /24 network
ffff:ffff:ffff:ffff:ffff:ffff:ffff:0/112: IPv6 address is too large
Expected: out of address space, cannot make another /112 network, the message Doc/library/ipaddress.rst gives for next_network().
CPython versions tested on:
CPython main branch
Operating systems tested on:
Linux
Linked PRs
- gh-156681
- gh-157280
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Hướng nghiên cứu
Xem xét _BaseNetwork.next_network() và phần diễn đạt về next_network() trong Doc/library/ipaddress.rst, sau đó tái hiện các ví dụ IPv4 và IPv6 từ issue. Được xem là hoàn tất khi tình trạng cạn kiệt không gian địa chỉ IPv6 báo cáo thông báo được tài liệu hóa “out of address space” cho mạng /112 thay vì “IPv6 address is too large”.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- python
- Lĩnh vực
- networking
- Loại issue
- Lỗi
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức phù hợp với người mới
- 25/100