TheWeirdDev / Bluetooth_Headset_Battery_Level

A python script to get battery level from Bluetooth headsets
GNU General Public License v3.0
760 stars 83 forks source link

Systemerror using Python 3.10 #73

Closed SvenZHB closed 2 years ago

SvenZHB commented 2 years ago

Using Python 3.10 on Manjaro (Arch) throws an error using the software.

Traceback (most recent call last): File "/usr/local/bin/bluetooth_battery", line 33, in <module> sys.exit(load_entry_point('bluetooth-battery==1.3.2', 'console_scripts', 'bluetooth_battery')()) File "/usr/lib/python3.10/site-packages/bluetooth_battery/bluetooth_battery.py", line 163, in main print("Battery level for {} is {}".format(device, str(query))) File "/usr/lib/python3.10/site-packages/bluetooth_battery/bluetooth_battery.py", line 93, in __str__ return "{:.0%}".format(self._perform_query() / 100) File "/usr/lib/python3.10/site-packages/bluetooth_battery/bluetooth_battery.py", line 105, in _perform_query sock.send(b"+BRSF: 1024") File "/usr/lib/python3.10/site-packages/bluetooth_battery/bluetooth_battery.py", line 66, in send return super().send(b"\r\n" + data + b"\r\n") File "<string>", line 3, in send SystemError: PY_SSIZE_T_CLEAN macro must be defined for '#' formats

TheWeirdDev commented 2 years ago

Duplicate of #71 (It's a pybluez bug and you have to wait for them to fix it).