]> git.ipfire.org Git - thirdparty/dnspython.git/commit
Render unnamed flag bits in to_text() instead of dropping them (#1276)
authorEugen Goebel <eugen-goebel@hotmail.de>
Sat, 27 Jun 2026 23:43:55 +0000 (01:43 +0200)
committerGitHub <noreply@github.com>
Sat, 27 Jun 2026 23:43:55 +0000 (16:43 -0700)
commit715fb880973ec56528c9ff238ec230be02067596
treea4e8225a7e401825d878950a20a066c7b794c88d
parentd9d25555efb3fdddfbb534342e137ef1bfe24b17
Render unnamed flag bits in to_text() instead of dropping them (#1276)

Closes #1264.

dns.flags.to_text() and dns.flags.edns_to_text() iterated only the named
enum members, so any set bit without a named flag (for example the EDNS
0x2000 bit) was silently dropped from the text representation. Such bits
are now rendered as FLAGn, where n is the bit position, and from_text()
and edns_from_text() parse that form back, so the conversions round-trip.

Adds tests in tests/test_flags.py and a whatsnew entry.

Fixes [#1264].

Co-authored-by: Eugen Goebel <eugen-goebel@users.noreply.github.com>
dns/flags.py
doc/whatsnew.rst
tests/test_flags.py