GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix: keep `key=` distinct from a valueless `key` in TXT records by bboe · Pull Request #1813 · python-zeroconf/python-zeroconf

Conversation

@bboe

@bboe bboe commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@codecov

codecov Bot commented Aug 12, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.81%. Comparing base (df947b2) to head (28edc80).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1813      +/-   ##
==========================================
- Coverage   99.81%   99.81%   -0.01%     
==========================================
  Files          33       33              
  Lines        3760     3759       -1     
  Branches      533      533              
==========================================
- Hits         3753     3752       -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.
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bboe
bboe force-pushed the fix/txt-empty-value branch from 8edd983 to 3f555e7 Compare August 12, 2026 20:23
@codspeed

codspeed Bot commented Aug 12, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 21 untouched benchmarks


Comparing bboe:fix/txt-empty-value (28edc80) with master (df947b2)

Open in CodSpeed
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bdraco

bdraco commented Aug 26, 2026

Copy link
Copy Markdown
Member

@bluetoothbot review

bluetoothbot reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bluetoothbot

bluetoothbot commented Aug 26, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Previous review — superseded by a newer review below.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

bluetoothbot
bluetoothbot approved these changes Aug 26, 2026
View reviewed changes

@bluetoothbot bluetoothbot left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tip

No blocking issues found — ready to merge.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@bluetoothbot

bluetoothbot commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

@bdraco: @bluetoothbot review

Re-reviewed. Head unchanged at 3f555e7. Fix still correct: sep branch inverts _set_properties exactly. Four nits carry over unresolved — stale key_sep_value=tuple at info.pxd:89, regression history in the info.py:468 comment, test docstring body, and the "decoded properties" comment at test_info.py:681 that passes info.properties. All non-blocking. Approving.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

bluetoothbot
bluetoothbot approved these changes Aug 26, 2026
View reviewed changes

@bluetoothbot bluetoothbot left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tip

No blocking issues found — ready to merge.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@bdraco

bdraco commented Aug 28, 2026

Copy link
Copy Markdown
Member

note that CI is red until #1820 but thats waiting for PSR

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bboe

bboe commented Aug 28, 2026

Copy link
Copy Markdown
Contributor Author

note that CI is red until #1820 but thats waiting for PSR

Thanks! I was briefly wondering what I might have broke.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bboe
bboe force-pushed the fix/txt-empty-value branch from 5e86eb1 to cd1f780 Compare August 28, 2026 04:17
bboe added 2 commits August 27, 2026 21:20
@bboe
fix: keep key= distinct from a valueless key in TXT records
a48ba16
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.
@bboe
chore: address code review comments
9f2b4ac
@bboe
bboe force-pushed the fix/txt-empty-value branch from cd1f780 to 9f2b4ac Compare August 28, 2026 04:20
@bdraco
Merge branch 'master' into fix/txt-empty-value
28edc80
@bluetoothbot

bluetoothbot commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

@bdraco: note that CI is red until #1820 but thats wai...

Branch now carries that fix. Merge commit 28edc80 pulls master, including df947b2 (#1820). CI should clear on rerun.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bluetoothbot

bluetoothbot commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

PR Review — fix: keep key= distinct from a valueless key in TXT records

Merge-ready — all four prior nits are now resolved and the fix is verified correct end to end.

What's solid:

  • info.py:467-471 branches on the partition separator, which is the exact inverse of _set_properties (info.py:416-420): a b"" value encodes as key=, None encodes as a bare key. This is the only partition(b"=") site in the tree (git grep), so the blast radius is contained.
  • info.pxd:89-96 now declares key/sep/value as bytes and drops the stale key_sep_value=tuple — the .pxd matches the .py in the same commit, per CLAUDE.md's build convention.
  • The comment is trimmed to the RFC 6763 §6.4 invariant, with the regression history left to the PR body.
  • The test docstring is a single line naming what it pins, and the round trip now loops over both info.properties and info.decoded_properties — the str form exercises the properties_contain_str encode path, where "" could plausibly have been re-collapsed to a bare key.

Notes, nothing blocking:

  • Downstream-visible decode change: key= now yields b"" / "" instead of None. That is the stated intent and restores pre-0.80.0 behaviour, but consumers doing props.get(b"x") is None will see it — worth a line in the release notes.
  • Pre-existing and untouched: an empty key (b"=") is still stored rather than ignored per RFC 6763 §6.4. The diff only changes what it stores (None -> b""), and the round trip still reproduces b"=", so no regression.
  • 28edc80 merges master, which carries the cython 3.3.0 build fix (fix: build with cython 3.3.0 #1820), so the earlier red CI should clear on the next run.

✅ Resolved since last review (2)

Previously-flagged issues verified fixed
  • src/zeroconf/_services/info.py:468 Comment carries the regression history, which CLAUDE.md routes to the PR body
  • tests/services/test_info.py:681 Comment says "decoded properties" but the assertion passes info.properties


Checklist

  • Decode is the inverse of encode (round trip verified against _set_properties)
  • No regression for existing None-valued properties
  • .pxd locals match the changed function signature
  • Comment/docstring conventions per CLAUDE.md
  • New behaviour covered by tests (bytes and str APIs, both encode paths)
  • Test isolation and teardown
  • Diff matches PR description, no scope creep
  • No security-relevant surface (no injection, secrets, deserialization, or path handling)

Automated review by Kōan (Claude) HEAD=28edc80 49s

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

bluetoothbot
bluetoothbot approved these changes Aug 28, 2026
View reviewed changes

@bluetoothbot bluetoothbot left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tip

No blocking issues found — ready to merge.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
bdraco
bdraco approved these changes Aug 28, 2026
View reviewed changes
@bdraco
bdraco merged commit 899eaaa into python-zeroconf:master Aug 28, 2026
38 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@bboe
bboe deleted the fix/txt-empty-value branch August 28, 2026 15:31
netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this pull request Aug 28, 2026
@0-wiz-0
py-zeroconf: update to 0.150.2.
9de92ef
## v0.150.2 (2026-08-28)

### Bug Fixes

- Keep `key=` distinct from a valueless `key` in TXT records
  ([#1813](python-zeroconf/python-zeroconf#1813),
  [`899eaaa`](python-zeroconf/python-zeroconf@899eaaa))


## v0.150.1 (2026-08-28)

### Bug Fixes

- Build with cython 3.3.0 ([#1820](python-zeroconf/python-zeroconf#1820),
  [`df947b2`](python-zeroconf/python-zeroconf@df947b2))
tsutsui pushed a commit to tsutsui/pkgsrc that referenced this pull request Oct 17, 2026
@0-wiz-0
py-zeroconf: update to 0.150.2.
b568a78
## v0.150.2 (2026-08-28)

### Bug Fixes

- Keep `key=` distinct from a valueless `key` in TXT records
  ([#1813](python-zeroconf/python-zeroconf#1813),
  [`899eaaa`](python-zeroconf/python-zeroconf@899eaaa))


## v0.150.1 (2026-08-28)

### Bug Fixes

- Build with cython 3.3.0 ([#1820](python-zeroconf/python-zeroconf#1820),
  [`df947b2`](python-zeroconf/python-zeroconf@df947b2))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@bdraco bdraco bdraco approved these changes
+1 more reviewer
@bluetoothbot bluetoothbot bluetoothbot approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@bboe @bdraco @bluetoothbot
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.
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.