Repository navigation
fix(dns): Call Resolver.query, which dnspython 1.x has (backport #7898) - #7899
Merged
Merged
Conversation
b8c335a (#7876) moved every DNS lookup to Resolver.resolve, which only exists in dnspython 2. Production still runs 1.x. The broad except in check_dns_cname and check_dns_a hides the AttributeError, so every custom domain check fails, and TLS renewals of custom domains do too. Query works on both versions. On 2.x it only gives a deprecation warning. The test patches the real Resolver class, because a mock has every attribute and would hide a missing method. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VhJqVgj53KVnJy9MFACx9m (cherry picked from commit 2cb2bed)
Collaborator
|
🎉 This PR is included in version 0.169.12 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Codecov Report❌ Patch coverage is
❌ Your patch status has failed because the patch coverage (63.15%) is below the target coverage (75.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## master #7899 +/- ##
==========================================
+ Coverage 65.14% 65.15% +0.01%
==========================================
Files 1114 1114
Lines 110339 110348 +9
Branches 2094 2094
==========================================
+ Hits 71876 71897 +21
+ Misses 38407 38395 -12
Partials 56 56
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
b8c335a (#7876) changed every DNS lookup to
Resolver.resolve. That method exists only in dnspython 2, and production still runs 1.x. The broadexceptincheck_dns_cnameandcheck_dns_ahides theAttributeError, so every custom domain check fails. TLS renewals of custom domains fail too.This changes the calls back to
query. It works on 1.x and 2.x (on 2.x it only gives a deprecation warning). The new test patches the realResolverclass, because a mock has every attribute and would hide a missing method. I reverted one call toresolveand the test failed.Tested locally on dnspython 1.16.0, with real DNS lookups in
bench console:Resolver.resolve(before)AttributeError: 'Resolver' object has no attribute 'resolve'check_dns_cname("github.com", "www.github.com")www.github.com. IN CNAME github.com.check_dns_a("github.com", "github.com")github.com. IN A 20.207.73.82check_dns_a("frappe.io", "frappe.io")get_mx_ip("gmail.com")press.utils.test_dnspasses (4 tests). Not run:selfhosted.py, the audit script, and the CAA and AAAA checks. They have the same one-word change.Custom domains whose TLS renewal failed after the deploy need a retry after this merges.
🤖 Generated with Claude Code
https://claude.ai/code/session_01VhJqVgj53KVnJy9MFACx9m
This is an automatic backport of pull request #7898 done by [Mergify](https://mergify.com).