TheWeirdDev / Bluetooth_Headset_Battery_Level

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

SystemError: PY_SSIZE_T_CLEAN macro must be defined for '#' formats #95

Closed dee0xeed closed 9 months ago

dee0xeed commented 9 months ago

At some moment (probably after some Mint dist upgrades) the script stopped working for me, I see this:

$ ./bluetooth_battery.py D3:D2:CA:93:93:CC
Traceback (most recent call last):
  File "./bluetooth_battery.py", line 283, in <module>
    main()
  File "./bluetooth_battery.py", line 272, in main
    result = query.query()
  File "./bluetooth_battery.py", line 131, in query
    result = self._perform_query_rfcomm()
  File "./bluetooth_battery.py", line 151, in _perform_query_rfcomm
    sock.send(b"+BRSF: 1024")
  File "./bluetooth_battery.py", line 70, 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

Python version is

Python 3.10.12 (main, Nov 20 2023, 15:14:05) [GCC 11.4.0] on linux

TheWeirdDev commented 9 months ago

Duplicate of https://github.com/TheWeirdDev/Bluetooth_Headset_Battery_Level/issues/78 , follow the instructions in that thread.

dee0xeed commented 9 months ago

Oops, sorry for duplicate, I did not look into closed issues before posting, my bad. Thanks for the link.