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

unclear exception on usage attempt #69

Closed ilyapashuk closed 2 years ago

ilyapashuk commented 2 years ago

when I try to use this project as an cli tool, I get the following exception: SystemError: PY_SSIZE_T_CLEAN macro must be defined for '#' formats

python 3.10, archlinux

SoMuchForSubtlety commented 2 years ago

Same on fedora using python 3.10

Traceback (most recent call last):
  File "/home/jakob/projects/Bluetooth_Headset_Battery_Level/./bluetooth_battery.py", line 166, in <module>
    main()
  File "/home/jakob/projects/Bluetooth_Headset_Battery_Level/./bluetooth_battery.py", line 163, in main
    print("Battery level for {} is {}".format(device, str(query)))
  File "/home/jakob/projects/Bluetooth_Headset_Battery_Level/./bluetooth_battery.py", line 93, in __str__
    return "{:.0%}".format(self._perform_query() / 100)
  File "/home/jakob/projects/Bluetooth_Headset_Battery_Level/./bluetooth_battery.py", line 105, in _perform_query
    sock.send(b"+BRSF: 1024")
  File "/home/jakob/projects/Bluetooth_Headset_Battery_Level/./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

See #71