Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-132099: Harmonize Bluetooth address handling#132486

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 ourterms of service andprivacy 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-storchakaserhiy-storchaka commentedApr 13, 2025
edited by github-actionsbot
Loading

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.

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

@serhiy-storchaka
Copy link
MemberAuthor

Since BTPROTO_HCI support on FreeBSD and all protocols on other BSD did not work just days ago, it is safe to do changes which otherwise could be considered breaking (changing the type of accepting or returning address).

BTPROTO_SCO was the only protocol that worked (only on Linux) with bytes addresses in older versions. Now it accepts both str and bytes.

Now all protocols always accept the Bluetooth address as string andgetsockname() 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.
@gpsheadgpshead added the 🔨 test-with-buildbotsTest PR w/ buildbots; report in status section labelApr 13, 2025
@bedevere-bot
Copy link

🤖 New build scheduled with the buildbot fleet by@gpshead for commit5552a33 🤖

Results will be shown at:

https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F132486%2Fmerge

If you want to schedule another build, you need to add the🔨 test-with-buildbots label again.

@bedevere-botbedevere-bot removed the 🔨 test-with-buildbotsTest PR w/ buildbots; report in status section labelApr 13, 2025
@serhiy-storchaka
Copy link
MemberAuthor

I tested on NetBSD and FreeBSD. Unfortunately, on FreeBSD all tests are skipped, so we can only hope that the code is correct.

@serhiy-storchakaserhiy-storchaka merged commit1fc1df8 intopython:mainApr 14, 2025
117 of 122 checks passed
@miss-islington-app
Copy link

Thanks@serhiy-storchaka for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13.
🐍🍒⛏🤖

@miss-islington-app
Copy link

Sorry,@serhiy-storchaka, I could not cleanly backport this to3.13 due to a conflict.
Please backport usingcherry_picker on command line.

cherry_picker 1fc1df8dcc7a853b0649bc8df37cd07cbd2b6230 3.13

@serhiy-storchakaserhiy-storchaka deleted the bluetooth-addr-type branchApril 14, 2025 05:59
serhiy-storchaka added a commit to serhiy-storchaka/cpython that referenced this pull requestApr 14, 2025
…H-132486)Now all protocols always accept the Bluetooth address as string andgetsockname() 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 commit1fc1df8)Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
@bedevere-app
Copy link

GH-132497 is a backport of this pull request to the3.13 branch.

@bedevere-appbedevere-appbot removed the needs backport to 3.13bugs and security fixes labelApr 14, 2025
serhiy-storchaka added a commit that referenced this pull requestApr 14, 2025
…H-132497)Now all protocols always accept the Bluetooth address as string andgetsockname() 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 commit1fc1df8)
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@gpsheadgpsheadgpshead approved these changes

@vstinnervstinnerAwaiting requested review from vstinner

Labels

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@serhiy-storchaka@bedevere-bot@gpshead

[8]ページ先頭

©2009-2025 Movatter.jp