Raise BadTTL for non-decimal Unicode digits in dns.ttl.from_text(). (#1279)
from_text() gated its integer parsing on str.isdigit(), then handed the
text to int(). str.isdigit() is True for Unicode "digit" characters whose
category is No (e.g. the superscript "\u00b2" or the Ethiopic "\u1369"),
but int() only accepts decimal digits, so such input escaped the parser's
validation and raised a bare ValueError instead of the documented
dns.ttl.BadTTL.
This was reachable through the public zone-file parser: a resource-record
TTL or a $TTL directive containing such a character crashed
dns.zone.from_text() with a ValueError rather than a clean
dns.exception.SyntaxError.
Switch both isdigit() checks to isdecimal(). For a single character,
int()-acceptance is exactly equivalent to isdecimal(), and isdecimal() is a
strict subset of isdigit(), so every previously valid TTL still parses while
the non-decimal digits are now rejected as BadTTL.
Add a regression test covering the fast (all-digit) path and the BIND-style
units path.
Bob Halley [Sun, 28 Jun 2026 01:00:10 +0000 (18:00 -0700)]
Fix uv globbing.
Source kit builds were not longer including the tests, examples,
and utilities because the glob stopped matching. Previously we
were using an "absolute" syntax starting with "/" but this doesn't
seem to work now.
Also, added tests/tsigkeys/*.key to the glob so they are included.
Eugen Goebel [Sat, 27 Jun 2026 23:43:55 +0000 (01:43 +0200)]
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>
dependabot[bot] [Sat, 28 Mar 2026 18:36:26 +0000 (11:36 -0700)]
Update uv-build requirement from <0.11.0,>=0.9.21 to >=0.9.21,<0.12.0 (#1265)
Updates the requirements on [uv-build](https://github.com/astral-sh/uv) to permit the latest version.
- [Release notes](https://github.com/astral-sh/uv/releases)
- [Changelog](https://github.com/astral-sh/uv/blob/main/CHANGELOG.md)
- [Commits](https://github.com/astral-sh/uv/compare/0.9.21...0.11.0)
Bob Halley [Wed, 18 Feb 2026 23:49:59 +0000 (15:49 -0800)]
Provide a "styled text" mechanism to comprehensively control (#1258)
text generation, and to make it easier to enhance in the future.
Styled text includes the ability to output to a (non-standard)
zonefile format which is like the normal format except that
Punycoded names are converted back to Unicode, and (optionally)
TXT-like records may use UTF-8, and if they do the text is rendered
as Unicode.
dependabot[bot] [Fri, 6 Feb 2026 16:22:35 +0000 (08:22 -0800)]
Update uv-build requirement from <0.10.0,>=0.9.21 to >=0.9.21,<0.11.0 (#1256)
Updates the requirements on [uv-build](https://github.com/astral-sh/uv) to permit the latest version.
- [Release notes](https://github.com/astral-sh/uv/releases)
- [Changelog](https://github.com/astral-sh/uv/blob/main/CHANGELOG.md)
- [Commits](https://github.com/astral-sh/uv/compare/0.9.21...0.10.0)
dependabot[bot] [Tue, 13 Jan 2026 15:48:04 +0000 (07:48 -0800)]
Bump sphinx-rtd-theme from 3.0.2 to 3.1.0 (#1253)
Bumps [sphinx-rtd-theme](https://github.com/readthedocs/sphinx_rtd_theme) from 3.0.2 to 3.1.0.
- [Changelog](https://github.com/readthedocs/sphinx_rtd_theme/blob/master/docs/changelog.rst)
- [Commits](https://github.com/readthedocs/sphinx_rtd_theme/compare/3.0.2...3.1.0)
Bob Halley [Sat, 15 Nov 2025 15:53:25 +0000 (07:53 -0800)]
Zone transfers should ignore glue that is not a subdomain of the
origin [#1236].
Ideally, we'd actually store this somewhere as in theory it is
needed for pathological cross zone dependencies. We are
not doing this as in practice such dependencies break a lot of
DNS software, and are usually not viable "in the wild".
Bob Halley [Wed, 8 Oct 2025 18:21:54 +0000 (11:21 -0700)]
Rename the getaddrinfo parameter "socktype" to "type" [#1231]
The socket type parameter to socket.getaddrinfo used to be called "socktype" in
Python 2, but was renamed to "type" in Python 3. We applied this change on
the python3 branch almost a decade ago, but it was lost in the "single code base,
only Python 3" update, also quite some time ago. It is now renamed to "type"
(again) so it matches the Python 3 code it is overriding.
Jakob Schlyter [Thu, 25 Sep 2025 18:01:43 +0000 (20:01 +0200)]
Initial changes to prepare for SIG(0) (#1202)
* # This is a combination of 6 commits.
# This is the 1st commit message:
Initial changes to prepare for SIG(0):
- Add shared RRSIGBase for code shared between RRSIG and SIG
- Add KEY RR
- Add SIG RR
# This is the commit message #2:
Parse flags mnemonics and symbolic protocol names
# This is the commit message #3:
RFC 2535 section 7.1 says "Note that if the type flags field has the NOKEY value, nothing appears after the algorithm octet."
# This is the commit message #4:
Include sphinx only for Python 3.11 or later (#1225)
* Include sphinx only for Python 3.11 or later
* Use python_version
# This is the commit message #5:
Save token before returning it (for exception handling)
# This is the commit message #6:
Replace get/unget with plain unget and last token
* Initial changes to prepare for SIG(0):
- Add shared RRSIGBase for code shared between RRSIG and SIG
- Add KEY RR
- Add SIG RR
- Parse flags mnemonics and symbolic protocol names