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

Macos Python 3.9 Error #493

Open
EnderRobber101 opened this issue Jan 23, 2024 · 0 comments
Open

Macos Python 3.9 Error #493

EnderRobber101 opened this issue Jan 23, 2024 · 0 comments

Comments

@EnderRobber101
Copy link

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

System

  • **Macos sonoma **
  • M1 macbook air
  • Python 3.9:
  • PyBluez Version: 0.30

Issue

I get this error for this code `import bluetooth

server_address = 'DC:A6:32:90:0F:DE' # Replace with your Raspberry Pi's Bluetooth address
port = 1

sock = bluetooth.BluetoothSocket(bluetooth.RFCOMM)
sock.connect((server_address, port))

while True:
data = input("Send: ")
if not data:
break
sock.send(data)

sock.close()
`
on my macos.
I used python 3.9 and installed use_2to3 to install

The raspberry pi running pi os was completely fine `import bluetooth

server_sock = bluetooth.BluetoothSocket(bluetooth.RFCOMM)

port = 1
server_sock.bind(("", port))
server_sock.listen(1)

client_sock, address = server_sock.accept()
print(f"Accepted connection from {address}")

while True:
data = client_sock.recv(1024)
if not data:
break
print(f"Received: {data}")

client_sock.close()
server_sock.close()
`

here was my error
macName Bluetooth % python3.9 main.py /opt/homebrew/lib/python3.9/site-packages/lightblue/_macutil.py:169: ObjCSuperWarning: Objective-C subclass uses super(), but super is not objc.super class BBCocoaSleeper(NSObject): /opt/homebrew/lib/python3.9/site-packages/lightblue/_macutil.py:192: ObjCSuperWarning: Objective-C subclass uses super(), but super is not objc.super class BBFileLikeObjectReader(NSObject): /opt/homebrew/lib/python3.9/site-packages/lightblue/_macutil.py:218: ObjCSuperWarning: Objective-C subclass uses super(), but super is not objc.super class BBFileLikeObjectWriter(NSObject): /opt/homebrew/lib/python3.9/site-packages/lightblue/_bluetoothsockets.py:760: ObjCSuperWarning: Objective-C subclass uses super(), but super is not objc.super class _ChannelEventListener(Foundation.NSObject): /opt/homebrew/lib/python3.9/site-packages/lightblue/_bluetoothsockets.py:834: ObjCSuperWarning: Objective-C subclass uses super(), but super is not objc.super class _ChannelServerEventListener(Foundation.NSObject): /opt/homebrew/lib/python3.9/site-packages/lightblue/_obex.py:338: ObjCSuperWarning: Objective-C subclass uses super(), but super is not objc.super class _BBOBEXClientDelegate(NSObject): /opt/homebrew/lib/python3.9/site-packages/lightblue/_obex.py:447: ObjCSuperWarning: Objective-C subclass uses super(), but super is not objc.super class BBOBEXObjectPushServer(NSObject): Traceback (most recent call last): File "/Users/pi/Documents/Coding Projects - Personal/Python/Bluetooth/main.py", line 7, in <module> sock.connect((server_address, port)) File "/opt/homebrew/lib/python3.9/site-packages/bluetooth/macos.py", line 119, in connect return self._sock.connect(addrport) File "/opt/homebrew/lib/python3.9/site-packages/lightblue/_bluetoothsockets.py", line 348, in connect self.__eventlistener = self.__createlistener() File "/opt/homebrew/lib/python3.9/site-packages/lightblue/_bluetoothsockets.py", line 642, in __createlistener listener = _ChannelEventListener.alloc().initWithDelegate_(self) File "/opt/homebrew/lib/python3.9/site-packages/lightblue/_bluetoothsockets.py", line 787, in initWithDelegate_ self = super().init() AttributeError: 'super' object has no attribute 'init' sys:1: UninitializedDeallocWarning: leaking an uninitialized object of type _ChannelEventListener macNamer Bluetooth %

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