fix: correct handling of IPv6 addresses with scope_id in ServiceInfo by bdraco · Pull Request #1322 · python-zeroconf/python-zeroconf
Navigation Menu
{{ message }}
python-zeroconf / python-zeroconf Public
- Notifications You must be signed in to change notification settings
- Fork 229
Merged
fix: correct handling of IPv6 addresses with scope_id in ServiceInfo#1322
fix: correct handling of IPv6 addresses with scope_id in ServiceInfo#1322
Conversation
Copy link Copy Markdown
Member
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
scope_id only works on python 3.9+ since < 3.9 doesn't support it
bdraco
force-pushed
the
fix_dupe_ipv6
branch
from
ae9b7c2 to
55de5d4
Compare
Copy link Copy Markdown
Codecov Report
All modified and coverable lines are covered by tests ✅
Comparison is base (
a200842) 99.77% compared to head (fba7272) 99.77%.
Report is 1 commits behind head on master.
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.
📢 Have feedback on the report? Share it here.
bdraco
force-pushed
the
fix_dupe_ipv6
branch
from
055fba0 to
1a20def
Compare
bdraco
mentioned this pull request
bdraco
force-pushed
the
fix_dupe_ipv6
branch
from
b33a88e to
fba7272
Compare
bdraco
changed the title
Fix handling of IPv6 addresses with scope_id in ServiceInfo
fix: correct handling of IPv6 addresses with scope_id in ServiceInfo
Copy link Copy Markdown
Member Author
bdraco
commented
Dec 10, 2023
bdraco commented
Dec 10, 2023That test is failing because there is a precision loss with the float to double conversion.
We should make all the floats doubles ..but for another PR
bdraco
merged commit
1682991
into
master
bdraco
deleted the
fix_dupe_ipv6
branch
bdraco
mentioned this pull request
Copy link Copy Markdown
twslankard
commented
Feb 3, 2024
twslankard commented
Feb 3, 2024@bdraco thanks for adding this fix! I was hoping to learn more about this:
scope_id only works on python 3.9+ since < 3.9 doesn't support it
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.
Copy link Copy Markdown
Member Author
bdraco
commented
Feb 3, 2024
bdraco commented
Feb 3, 2024https://docs.python.org/3.8/library/ipaddress.html -- scope_id is missing here
https://docs.python.org/3.9/library/ipaddress.html -- scope_id is present here
Copy link Copy Markdown
twslankard
commented
Feb 3, 2024
twslankard commented
Feb 3, 2024Thanks @bdraco !
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