Skip to content

[3.13] gh-132099: Harmonize Bluetooth address handling (GH-132486) #132497

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

Merged

Conversation

serhiy-storchaka
Copy link
Member

@serhiy-storchaka serhiy-storchaka commented Apr 14, 2025

Now all protocols always accept the Bluetooth address as string and getsockname() always returns the Bluetooth address as string.

  • BTPROTO_SCO now accepts not only bytes, but str.
  • BTPROTO_SCO now checks address for embedded null.
  • On *BSD, BTPROTO_HCI now accepts str instead of bytes.
  • On FreeBSD, getsockname() for BTPROTO_HCI now returns str instead of bytes.
  • On NetBSD and DragonFly BSD, BTPROTO_HCI now checks address for embedded null.

(cherry picked from commit 1fc1df8)


📚 Documentation preview 📚: https://cpython-previews--132497.org.readthedocs.build/

…H-132486)

Now all protocols always accept the Bluetooth address as string and
getsockname() always returns the Bluetooth address as string.

* BTPROTO_SCO now accepts not only bytes, but str.
* BTPROTO_SCO now checks address for embedded null.
* On *BSD, BTPROTO_HCI now accepts str instead of bytes.
* On FreeBSD, getsockname() for BTPROTO_HCI now returns str instead of bytes.
* On NetBSD and DragonFly BDS, BTPROTO_HCI now checks address for embedded null.
(cherry picked from commit 1fc1df8)

Co-authored-by: Serhiy Storchaka <[email protected]>
@serhiy-storchaka serhiy-storchaka merged commit d321b6e into python:3.13 Apr 14, 2025
40 checks passed
@serhiy-storchaka serhiy-storchaka deleted the backport-1fc1df8-3.13 branch April 14, 2025 16:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant