wire = q.to_wire()
the_connection: dns.quic.AsyncQuicConnection
if connection:
- cfactory = dns.quic.null_factory
- mfactory = dns.quic.null_factory
+ cfactory = dns.quic.null_factory # type: ignore
+ mfactory = dns.quic.null_factory # type: ignore
else:
- (cfactory, mfactory) = dns.quic.factories_for_backend(backend)
+ (cfactory, mfactory) = dns.quic.factories_for_backend(backend) # type: ignore
async with cfactory() as context:
async with mfactory(
wire = q.to_wire()
the_connection: dns.quic.AsyncQuicConnection
if connection:
- cfactory = dns.quic.null_factory
- mfactory = dns.quic.null_factory
+ cfactory = dns.quic.null_factory # type: ignore
+ mfactory = dns.quic.null_factory # type: ignore
the_connection = connection
else:
- (cfactory, mfactory) = dns.quic.factories_for_backend(backend)
+ (cfactory, mfactory) = dns.quic.factories_for_backend(backend) # type: ignore
async with cfactory() as context:
async with mfactory(
l = len(self.labels)
if depth == 0:
- return (self, dns.name.empty)
+ return (self, empty)
elif depth == l:
- return (dns.name.empty, self)
+ return (empty, self)
elif depth < 0 or depth > l:
raise ValueError("depth must be >= 0 and <= the length of the name")
return (Name(self[:-depth]), Name(self[-depth:]))
new_labels = [least_significant_label + _MINIMAL_OCTET]
new_labels.extend(name.labels[1:])
try:
- return dns.name.Name(new_labels)
- except dns.name.NameTooLong:
+ return Name(new_labels)
+ except NameTooLong:
pass
# We can't extend the label either, so we'll try to increment the least
# signficant non-maximal byte in it.
q.id = 0
wire = q.to_wire()
the_connection: dns.quic.SyncQuicConnection
- the_manager: dns.quic.SyncQuicManager
+ the_manager: dns.quic.SyncQuicManager # type: ignore
if connection:
manager: contextlib.AbstractContextManager = contextlib.nullcontext(None)
else:
- manager = dns.quic.SyncQuicManager(
+ manager = dns.quic.SyncQuicManager( # type: ignore
verify_mode=verify, server_name=hostname, h3=True # type: ignore
)
the_manager = manager # for type checking happiness
q.id = 0
wire = q.to_wire()
the_connection: dns.quic.SyncQuicConnection
- the_manager: dns.quic.SyncQuicManager
+ the_manager: dns.quic.SyncQuicManager # type: ignore
if connection:
manager: contextlib.AbstractContextManager = contextlib.nullcontext(None)
the_connection = connection
else:
- manager = dns.quic.SyncQuicManager(
+ manager = dns.quic.SyncQuicManager( # type: ignore
verify_mode=verify, server_name=hostname # type: ignore
)
the_manager = manager # for type checking happiness
f: Any,
sorted: bool = True,
relativize: bool = True,
- nl: str | None = None,
+ nl: str | bytes | None = None,
want_comments: bool = False,
want_origin: bool = False,
) -> None:
names in the output will be relativized to the zone's origin
if possible.
- *nl*, a ``str`` or None. The end of line string. If not
+ *nl*, a ``str``, ``bytes``, or None. The end of line string. If not
``None``, the output will use the platform's native
end-of-line marker (i.e. LF on POSIX, CRLF on Windows).
else:
cm = contextlib.nullcontext(f)
with cm as f:
+ assert f is not None
# must be in this way, f.encoding may contain None, or even
# attribute may not be there
file_enc = getattr(f, "encoding", None)