`IPv6Network.next_network()` raises the wrong error when addresses run out
オープン
まだ誰も着手していません。
stdlib
type-bug
- 主要言語
- Python
- スター
- 77.2k
- フォーク
- 35.9k
- PR マージ指標
- PR 指標を取得中
説明
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
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
_BaseNetwork.next_network() と Doc/library/ipaddress.rst 内の next_network() の文言を確認し、その後 issue の IPv4 および IPv6 の例を再現します。完了条件は、IPv6 アドレス空間の枯渇時に、/112 ネットワークについて「IPv6 address is too large」ではなく、文書化されている「out of address space」というメッセージが報告されることです。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- python
- 領域
- networking
- issue の種類
- バグ
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 活発さ
- 停滞
- 明瞭さ
- 明確に書かれている
- 初心者へのやさしさ
- 25/100