Skip to content

_cb.Peripheral.write_characteristic_value raises SystemError #778

Closed

Description

@o-murphy

I'm developing the bleak-compatible backend based on built-in _cb module. It is almost done, discover, connection, notifying and value reading works, but in the end I encountered an unexpected problem, it looks like _cb.Peripheral. write_characteristic_value(...) has a C-level bug that raises SystemError: PY_SSIZE_T_CLEAN macro must be defined for '#' formats

self.client.write_gatt_char(
  File "/private/var/mobile/Containers/Shared/AppGroup/FE817F0D-F288-48F8-A509-E7559374B783/Pythonista3/Documents/site-packages/bleak/__init__.py", line 723, in write_gatt_char
    await self._backend.write_gatt_char(characteristic, data, response)
  File "/private/var/mobile/Containers/Shared/AppGroup/FE817F0D-F288-48F8-A509-E7559374B783/Pythonista3/Documents/site-packages/bleak_pythonista/backend/pythonistacb/client.py", line 278, in write_gatt_char
    await self._delegate.write_characteristic(
  File "/private/var/mobile/Containers/Shared/AppGroup/FE817F0D-F288-48F8-A509-E7559374B783/Pythonista3/Documents/site-packages/bleak_pythonista/backend/pythonistacb/CentralManager.py", line 475, in write_characteristic
    p.write_characteristic_value(c, value, with_response)
SystemError: PY_SSIZE_T_CLEAN macro must be defined for '#' formats

Activity

  1. changed the title [-]_cb.Peripheral.write_characteristic_value raises C-level error[/-] [+]_cb.Peripheral.write_characteristic_value raises SystemError[/+] on Jul 29, 2025
  2. o-murphy commented on Jul 29, 2025

    @o-murphy
    Author

    @cclauss

    Thanks, but I have not access to Pythonista 3.5 testflight

  3. omz commented on Jul 30, 2025

    @omz
    Owner

    @cclauss

    Thanks, but I have not access to Pythonista 3.5 testflight

    @o-murphy I've just sent you a TestFlight invite to the email address on your GitHub profile.

  4. o-murphy commented on Jul 30, 2025

    @o-murphy
    Author

    @cclauss
    Thanks, but I have not access to Pythonista 3.5 testflight

    @o-murphy I've just sent you a TestFlight invite to the email address on your GitHub profile.

    Thanks dude! I'm happy with it

  5. techfoamer commented on Mar 1, 2026

    @techfoamer

    I'm having the same problem, any estimate of when Pythonista 3.5 will be released?

  6. dlimabean commented on Oct 31, 2026

    @dlimabean

    Looking forward to next release. I want to use BLE commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions