or run

tessl search
Log in

Version

Workspace
tessl
Visibility
Public
Created
Last updated
Describes
pypipkg:pypi/dnspython@1.16.x
tile.json

tessl/pypi-dnspython

tessl install tessl/pypi-dnspython@1.16.0

DNS toolkit for Python supporting almost all record types with high-level and low-level DNS operations

Agent Success

Agent success rate when using this tile

85%

Improvement

Agent success rate improvement when using this tile compared to baseline

1.37x

Baseline

Agent success rate without this tile

62%

task.mdevals/scenario-5/

System Resolver Override Utility

Provide a context-managed override that routes Python's socket-level hostname lookups through a configurable DNS resolver built with the dependency. The override must be reversible and safe for repeated use.

Capabilities

Route socket lookups through custom nameservers

  • Activating the override with a nameserver list forces socket.getaddrinfo calls to resolve via that resolver instead of OS defaults. @test
  • After the override is restored, new socket lookups use the original system resolver results, proving all hooks were removed. @test

Context-managed safety

  • Entering the override via a context manager applies it for the block and restores it even when an exception is raised inside the block. @test

Resolver configuration options

  • The override accepts timeout and search domain options; DNS lookups honor those settings while the override is active. @test

Active state reporting

  • A status property indicates when the override is active; nested activations increment state but only the final restore clears it. @test

Implementation

@generates

API

from __future__ import annotations
from typing import Iterable, Optional

class SystemResolverOverride:
    def __init__(self, nameservers: Iterable[str], *, timeout: Optional[float] = None, search: Optional[Iterable[str]] = None) -> None: ...
    def activate(self) -> None: ...
    def restore(self) -> None: ...
    def __enter__(self) -> "SystemResolverOverride": ...
    def __exit__(self, exc_type, exc, tb) -> None: ...
    @property
    def active(self) -> bool: ...

Dependencies { .dependencies }

dnspython { .dependency }

Provides resolver override hooks to route Python socket DNS lookups through configurable nameservers. @satisfied-by