DARcorporation / xfoil-python

Stripped down version of XFOIL as compiled python module
GNU General Public License v3.0
87 stars 60 forks source link

Changes to DLL search in Python 3.8 break things #10

Open eufren opened 4 years ago

eufren commented 4 years ago

Attempting to do XFoil() after a successful installation makes ctypes complain that it can't find the temp .dll or dependencies.

I worked around this by adding:

def __init__(self):
        super().__init__()
        tmp = NamedTemporaryFile(mode='wb', delete=False, suffix=lib_ext)
        tmp.close()
        self._lib_path = tmp.name
        copy2(lib_path, self._lib_path)
        os.add_dll_directory(r"C:\Windows\System32")
        os.add_dll_directory(r"C:\Users\euana\Documents\Perl\c\bin")
        self._lib = cdll.LoadLibrary(self._lib_path)
        self._lib.init()
        self._airfoil = None