New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: correct handling of IPv6 addresses with scope_id in ServiceInfo #1322
Conversation
ae9b7c2
to
55de5d4
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1322 +/- ##
=======================================
Coverage 99.77% 99.77%
=======================================
Files 29 29
Lines 3087 3104 +17
Branches 518 521 +3
=======================================
+ Hits 3080 3097 +17
Misses 5 5
Partials 2 2 ☔ View full report in Codecov by Sentry. |
055fba0
to
1a20def
Compare
b33a88e
to
fba7272
Compare
That test is failing because there is a precision loss with the float to double conversion. |
@bdraco thanks for adding this fix! I was hoping to learn more about this:
Do you have a reference for this? I'm trying to find out whether it's possible to get the scope id in Python 3.8 some other way and haven't had much luck finding more info yet. |
https://docs.python.org/3.8/library/ipaddress.html -- https://docs.python.org/3.9/library/ipaddress.html -- |
Thanks @bdraco ! |
The scope_id was missing because it should come from the DNSAddress record and not the object itself if the ServiceInfo is pulling from the cache. This also lead to duplicate IPv6 records being returned because the scope id was missing
fixes #1321
fixes #1288
scope_id only works on python 3.9+ since < 3.9 doesn't support it