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

TypeError: tp_basicsize for type '_bleak_winrt_Windows_Foundation.EventRegistrationToken' (24) is too small for base '_winrt.Object' (32) #116

Open
fernandoaestrella opened this issue Oct 30, 2023 · 5 comments

Comments

@fernandoaestrella
Copy link

The problem
Provide a clear and concise description of what the problem is.

Copied the example from here https://github.com/kevincar/bless/blob/master/examples/server.py and ran it

Reproduction
Provide instructions or code samples that demonstrate the issue if possible>

Copied the example from here https://github.com/kevincar/bless/blob/master/examples/server.py to VS Code in a new python file, inside a virtual environment (virtual environment folder is called ".venv")

imported bless via
python -m pip install bless
and ran it
an error indicated I didn't have bleak_winrt so i got it via
python -m pip install bleak-winrt
then I ran it again and got the error below

Expected behavior
Provide a clear and concise description of what you expected to happen.

Expected the server to run and advertise a BLE message

Screenshots
If applicable, add screenshots to help explain your problem.

Traceback (most recent call last):
File "d:\dev\magic\py\sb\boxes\ble_s\main.py", line 12, in
from bless import ( # type: ignore
File "d:\dev\magic\py\venv\Lib\site-packages\bless_init_.py", line 41, in
from bless.backends.winrt.server import ( # noqa: F401
File "d:\dev\magic\py\venv\Lib\site-packages\bless\backends\winrt\server.py", line 14, in
from bless.backends.winrt.service import BlessGATTServiceWinRT
File "d:\dev\magic\py\venv\Lib\site-packages\bless\backends\winrt\service.py", line 4, in
from bleak_winrt.windows.devices.bluetooth.genericattributeprofile import ( # type: ignore # noqa: E501
File "d:\dev\magic\py\venv\Lib\site-packages\bleak_winrt\windows\devices\bluetooth_init_.py", line 10, in
import bleak_winrt.windows.devices.bluetooth.genericattributeprofile
File "d:\dev\magic\py\venv\Lib\site-packages\bleak_winrt\windows\devices\bluetooth\genericattributeprofile_init_.py", line 15, in
import bleak_winrt.windows.devices.enumeration
File "d:\dev\magic\py\venv\Lib\site-packages\bleak_winrt\windows\devices\enumeration_init_.py", line 15, in
import bleak_winrt.windows.foundation
File "d:\dev\magic\py\venv\Lib\site-packages\bleak_winrt\windows\foundation_init_.py", line 7, in
_ns_module = bleak_winrt.import_ns_module("Windows.Foundation")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "d:\dev\magic\py\venv\Lib\site-packages\bleak_winrt_init
.py", line 15, in _import_ns_module
module = module_from_spec(spec)
^^^^^^^^^^^^^^^^^^^^^^
TypeError: tp_basicsize for type '_bleak_winrt_Windows_Foundation.EventRegistrationToken' (24) is too small for base '_winrt.Object' (32)

Desktop (please complete the following information):

  • OS: [e.g. Windows, macOS, Linux]
    Win10

Additional context
Add any other context about the problem here.

@magnusjjj
Copy link

Got the exakt same error, windows 11 :).

@goodztc
Copy link

goodztc commented May 20, 2024

I encountered the same problem and found that using a lower version of Python can solve it, Verified on Python version 3.9.19

@goodztc
Copy link

goodztc commented May 20, 2024

Got the exakt same error, windows 11 :).

you can try Python version 3.9.19

@LucasVos
Copy link

Same issue here.. I would love to stay on Python 3.12 instead of going down :-)
Is there another workaround?

@102-97-98-105
Copy link

If anyone else stumbles upon this topic: #129

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

5 participants