Skip to content

fix: keep key= distinct from a valueless key in TXT records - #1813

Open
bboe wants to merge 1 commit into
python-zeroconf:masterfrom
bboe:fix/txt-empty-value
Open

fix: keep key= distinct from a valueless key in TXT records#1813
bboe wants to merge 1 commit into
python-zeroconf:masterfrom
bboe:fix/txt-empty-value

Conversation

@bboe

@bboe bboe commented Aug 12, 2026

Copy link
Copy Markdown

RFC 6763 6.4: a key with no '=' is a boolean attribute; key= is present with an empty value. Collapsing both to None makes them indistinguishable, so a received key= re-encodes as a bare key.

Regression in #1225 (first released in 0.80.0), which replaced explicit branching on the separator with value or None. Restores the behaviour #226 introduced.

@codecov

codecov Bot commented Aug 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.81%. Comparing base (fce7094) to head (3f555e7).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1813      +/-   ##
==========================================
- Coverage   99.81%   99.81%   -0.01%     
==========================================
  Files          33       33              
  Lines        3750     3749       -1     
  Branches      533      533              
==========================================
- Hits         3743     3742       -1     
  Misses          5        5              
  Partials        2        2              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

RFC 6763 6.4: a key with no '=' is a boolean attribute; `key=` is present
with an empty value. Collapsing both to None makes them indistinguishable,
so a received `key=` re-encodes as a bare `key`.

Regression in python-zeroconf#1225 (first released in 0.80.0), which replaced explicit
branching on the separator with `value or None`. Restores the behaviour
python-zeroconf#226 introduced.
@bboe
bboe force-pushed the fix/txt-empty-value branch from 8edd983 to 3f555e7 Compare August 12, 2026 20:23
@codspeed-hq

codspeed-hq Bot commented Aug 12, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 21 untouched benchmarks


Comparing bboe:fix/txt-empty-value (3f555e7) with master (fce7094)

Open in CodSpeed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant