Skip to content
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

BluetoothSocket creates bad socket object #473

Open
limburgher opened this issue Apr 12, 2023 · 0 comments
Open

BluetoothSocket creates bad socket object #473

limburgher opened this issue Apr 12, 2023 · 0 comments

Comments

@limburgher
Copy link

PyBluez is not under active development but we are seeking new contributors
to investigate bugs and submit patches.

System

  • Fedora Linux 38
  • x86_64
  • 3.11
  • 0.23

Issue

s = bluetooth.BluetoothSocket(RFCOMM) s.connect((self.device['host'], self.device['port'])) creates unusable socket object which throws: bluetooth.btcommon.BluetoothError: [Errno 14] Bad address It should create the same (or functionally equivalent) socket object to: s = socket.socket(socket.AF_BLUETOOTH, socket.SOCK_STREAM, socket.BTPROTO_RFCOMM) s.connect((self.device['host'], self.device['port'])) However, using BluetoothSocket(RFCOMM) results in a socket which throws an exception whenever a write is attempted whereas the socket object works. Version-Release number of selected component (if applicable): python3-bluez-0.23-10.fc38.x86_64 How reproducible: ALways Steps to Reproduce: 1. s = bluetooth.BluetoothSocket(RFCOMM) 2. s.connect(mac_address, port) 3. s.send("foo") Actual results: bluetooth.btcommon.BluetoothError: [Errno 14] Bad address Expected results: Success (no exception) Additional info: This is code that has been working on Fedora for a decade. It works on Fedora 35. I just upgraded to 38. I have not tried Fedora 36 & 37. Collapse All Comments Expand All Comments Add Comment

s = bluetooth.BluetoothSocket(RFCOMM)
s.connect((self.device['host'], self.device['port']))

creates unusable socket object which throws:
bluetooth.btcommon.BluetoothError: [Errno 14] Bad address

It should create the same (or functionally equivalent) socket object to:

s = socket.socket(socket.AF_BLUETOOTH, socket.SOCK_STREAM, socket.BTPROTO_RFCOMM)
s.connect((self.device['host'], self.device['port']))

However, using BluetoothSocket(RFCOMM) results in a socket which throws an exception whenever a write is attempted whereas the socket object works.

Version-Release number of selected component (if applicable):
python3-bluez-0.23-10.fc38.x86_64

How reproducible:
ALways

Steps to Reproduce:

  1. s = bluetooth.BluetoothSocket(RFCOMM)
  2. s.connect(mac_address, port)
  3. s.send("foo")

Actual results:
bluetooth.btcommon.BluetoothError: [Errno 14] Bad address

Expected results:
Success (no exception)

Additional info:
This is code that has been working on Fedora for a decade. It works on Fedora 35. I just upgraded to 38. I have not tried Fedora 36 & 37.

[Collapse All Comments](https://bugzilla.redhat.com/show_bug.cgi?id=2185336#)
[Expand All Comments](https://bugzilla.redhat.com/show_bug.cgi?id=2185336#)

Add Comment

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

No branches or pull requests

1 participant