feat: ensure ServiceInfo.properties always returns bytes by bdraco · Pull Request #1333 · python-zeroconf/python-zeroconf

@bdraco

Clean up the typing on `ServiceInfo.properties` to always return bytes.

The typing on properties was very confusing because it could have a mix of bytes
and str types, but only bytes would ever come back from the backend and cache.
The only way str could happen is if someone manually passed it in.

We now ensure all passed in data is converted to bytes

@bdraco

@bdraco

openstack-mirroring pushed a commit to openstack/openstack that referenced this pull request

Jan 5, 2024
* Update ironic-lib from branch 'master'
  to 523407eebf22b68a3b1a3926666e8bb24fedf871
  - Merge "Compatibility with zeroconf 0.129.0"
  - Compatibility with zeroconf 0.129.0
    
    From Zeroconf CHANGELOG.md:
    v0.129.0 (2023-12-13)
    
    Feature
    
    * Add decoded_properties method to ServiceInfo
    python-zeroconf/python-zeroconf#1332
    python-zeroconf/python-zeroconf@9b595a1
    * Ensure ServiceInfo.properties always returns bytes
    python-zeroconf/python-zeroconf#1333
    python-zeroconf/python-zeroconf@d29553a
    
    Technically breaking change
    
    * `ServiceInfo.properties` always returns a dictionary with type
    `dict[bytes, bytes | None]` instead of a mix `str` and `bytes`. It was
    only possible to get a mixed dictionary if it was manually passed in
    when `ServiceInfo` was constructed.
    
    Co-Authored-By: Dmitry Tantsur <dtantsur@protonmail.com>
    Change-Id: I7f1a0c3329e5f29ec3e274558e3681142cc2ef78