Message358033
I am calling a python method from C using the attached code.
The Site.py file is:
import os
def find_site():
path = os.path.abspath(".")
return path
Cross compiled to Windows from Linux using mxe.cc and python 2.7.17
On 32-bit this runs as expected:
module = 028BC710
result = 0283D6B0
Found Site at \\wsl$\Ubuntu\home\dl
result = 0283D6B0 decref
module = 028BC710 decref
Site = \\wsl$\Ubuntu\home\dl
but crashes on 64-bit, failing to DECREF result:
module = 0000000002750408
result = 0000000000E62EF0
Found Site at \\wsl$\Ubuntu\home\dl
result = 0000000000E62EF0 decref
In both cases the libpython was made using the .dll copied from the target Windows machine and pexports and dlltool to create the .a
if the return value of the python is return "C:/Test/Path" it works. if you add test2 = test and return test2 it fails. if you say test2 = "".join(c for c in path) and return test2 it fails. if you set path2 = "C:/Test/Path and return test2 it works
using Py_REFCNT [in the C code] shows a value of 2 for a return "c:/test" but a value of 1 a return test |
|
Date |
User |
Action |
Args |
2019-12-08 21:07:59 | Dave Lawrence | set | recipients:
+ Dave Lawrence, paul.moore, tim.golden, zach.ware, steve.dower |
2019-12-08 21:07:58 | Dave Lawrence | set | messageid: <1575839278.99.0.426657382539.issue39001@roundup.psfhosted.org> |
2019-12-08 21:07:58 | Dave Lawrence | link | issue39001 messages |
2019-12-08 21:07:58 | Dave Lawrence | create | |
|