print("THE TYPE: "+str(
(sdlttf_funcs["TTF_SizeUTF8"],
type(sdlttf_funcs["TTF_SizeUTF8"]))))
_sdl_TextSize_utf8_addrint= (
ctypes.addressof( # this is line 84 in the backtracesdlttf_funcs["TTF_SizeUTF8"]))
Now it doesn't, output:
THE TYPE: (<function TTF_SizeUTF8 at 0x7fc0e01d09a0>, <class 'function'>)
Traceback (most recent call last):
File "/home/user/Develop/mypen/./main.py", line 20, in <module>
main()
File "/home/user/.local/lib/python3.11/site-packages/mypen/main.py", line 144, in main
show_document_list(window)
File "/home/user/.local/lib/python3.11/site-packages/mypen/uiwindowdocumentlist.py", line 542, in show_document_list
set_current_ui(DocumentOpenUi(window))
File "/home/user/.local/lib/python3.11/site-packages/mypen/ui.py", line 238, in set_current_ui
set_cleared_ui(window)
File "/home/user/.local/lib/python3.11/site-packages/mypen/ui.py", line 52, in set_cleared_ui
top_label = Label()
^^^^^^^
File "src/myui/label.pyx", line 84, in myui.label.Label.__init__
File "src/myui/font/manager.pyx", line 100, in myui.font.manager.Font.render_size
File "src/myui/font/sdlfont.pyx", line 216, in myui.font.sdlfont.get_thread_safe_render_size
File "src/myui/font/sdlfont.pyx", line 84, in myui.font.sdlfont._get_font_size_fast_unthreaded
TypeError: invalid type
I'm not 100% sure this isn't a regression in Cython instead, I can't easily test that since older Cython versions don't work with Python 3.11. It looks to me like the ctypes function ctypes.addressof is emitting the error and the source of the problem, but who knows I guess.
The text was updated successfully, but these errors were encountered:
$ python 1.pyTraceback (most recent call last): File "/private/tmp/1.py", line 2, in <module> (sdlttf_funcs["TTF_SizeUTF8"], ^^^^^^^^^^^^NameError: name 'sdlttf_funcs' is not defined
Please can you share a minimal, reproducible example?
ell1e commentedDec 21, 2022
•
edited by hugovk
Bug report
This used to work:
Now it doesn't, output:
This is important to get a function from ctypes into a Cython function pointer: https://stackoverflow.com/questions/49635105/ctypes-get-the-actual-address-of-a-c-function
(Which is needed in some situations for performance reasons)
Your environment
Python 3.11.0 (main, Oct 24 2022, 00:00:00) [GCC 12.2.1 20220819 (Red Hat 12.2.1-2)] on linux
I'm not 100% sure this isn't a regression in Cython instead, I can't easily test that since older Cython versions don't work with Python 3.11. It looks to me like the ctypes function
ctypes.addressof
is emitting the error and the source of the problem, but who knows I guess.The text was updated successfully, but these errors were encountered: