UnicodeDecode error during import of modules

Environment

  • Pythonnet version: 2.4.0
  • Python version: 3.7.5
  • Operating System: Windows 10

Details

  • When trying to import an opaque DLL (I have sources, but I prefer to not compile on my system because is related to a project not maintained by me), i experience this error:

`
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe0 in position 12: unexpected end of data

The above exception was the direct cause of the following exception:

SystemError: <class 'UnicodeDecodeError'> returned a result with an error set

The above exception was the direct cause of the following exception:

SystemError: <built-in method mro of CLR Metatype object at 0x09ABF208> returned a result with an error set
`

It seems related to encoding in function names, but I inspected the DLL (both source code and with ILSpy) and I don't find anything strange.