f90wrap icon indicating copy to clipboard operation
f90wrap copied to clipboard

example with fortran to python callback function fails with as of f90wrap v0.2.13: "bad argument to internal function"

Open jmp75 opened this issue 2 years ago • 1 comments

I had set up an example for setting up a callback function (#93). This resulted in a an example under examples/callback_print_function_issue93 . I am trying to re-run this example with f90wrap v0.2.13 and if fails to work as expected.

---------------------------------------------------------------------------
SystemError                               Traceback (most recent call last)
Cell In[9], line 1
----> 1 CBF.caller.test_write_msg()

File ~/src/f90wrap/examples/callback_print_function_issue93/CBF.py:53, in Caller.test_write_msg()
     43 @staticmethod
     44 def test_write_msg():
     45     """
     46     test_write_msg()
     47     
   (...)
     51     
     52     """
---> 53     _CBF.f90wrap_test_write_msg()

SystemError: /home/conda/feedstock_root/build_artifacts/python-split_1669131725489/work/Objects/tupleobject.c:159: bad argument to internal function

It might be related to #195, but not at all sure this is a single bug.

jmp75 avatar Nov 17 '23 06:11 jmp75

This is probably happening at this line 159 of tupleobject.c in cypthon 3.9

Also, I can reproduce this issue with f90wrap 0.2.5 on python 3.9. My example was contributed such that it would have worked with f90wrap 0.2.2 (not sure which version of cpython though)

jmp75 avatar Nov 17 '23 06:11 jmp75