You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[ Y ] Are you reporting to the correct repository?
[ Y ] Did you perform a cursory search?
Description
In loading a .NET dll, I get a SystemError that does not come out when compiling with ipyc. See code below.
Steps to Reproduce
Code used in file testIPY.py
import clr
# import my api
clr.AddReferenceToFileAndPath("myClass.dll")
import myClass
tt=myClass.API() # instance of my object
print(tt.version()) # return version
input("Press key to close...")
if I run ipy testIPY.py I get:
Traceback (most recent call last):
File "testIPY.py", line 6, in <module>
SystemError: L'inizializzatore di tipo di 'myInnerClass.innerClass' ha generato un'eccezione.
if I compile with ipyc /main:testIPY.py /target:exe, I can run testIPY.exe flawlessly. Output is:
1.00000000000001
Press key to close...Error occurred: unknown encoding: cp850
Version Information
If you are using the ipy console program, provide output of executing ipy -VV. If it is a local build, provide also the git hash of the commit used to build IronPython. Additionally, provide the type of the operating system used.
I made other tests, unfortunately all unsuccessful:
When libraries are not obfuscated, everything works
The problem is related to the differences in IronPython code in loading .net dlls.l, because as told, the compiled scripts works fine, but .py script does not. I believe this should be corrected, as the same obduscated libraries load unfaulty in Pythonnet, and one should expect the same behaviour
Since dlls are obfuscated, the only way possible to debug is to add these command line flags to ipy exe
By doing this, I found out that a dependency dll cannot be found, which is also obfuscated.
My dlls have a custom Assembly resolver, which may help in loading assemblies. Since the error described at point 3. happens in the constructor, it seems that ipy is the only responsible to find the assembly. I tried to have ipy.exe and its dependencies in the same folder of my dlls, and also to add folders to path. Nothing changed.
I hope this may help in finding a solution, the main problem to me is to assure that the same assembly loading mechanism has to be used both for compiled and non compiled scripts.
Anyone having the same problem?
I'm still seeking for a solution, but I believe the different behaviour of compiled and interpreted script is due to a bug in IPY - it seems Assembly loading mechanism is behaving differently...
Prerequisites
The issue tracker is used to report bugs and request new features, NOT to ask questions.
Questions should be posted in Discussions or to the users mailing list which can be accessed at
https://ironpython.groups.io/g/users.
Description
In loading a .NET dll, I get a SystemError that does not come out when compiling with ipyc. See code below.
Steps to Reproduce
Code used in file testIPY.py
ipy testIPY.py
I get:ipyc /main:testIPY.py /target:exe
, I can run testIPY.exe flawlessly. Output is:Version Information
If you are using the
ipy
console program, provide output of executingipy -VV
. If it is a local build, provide also the git hash of the commit used to build IronPython. Additionally, provide the type of the operating system used.Ufortunately I cannot share the DLL, which is obfuscated. Debug DLL does not exhibit the same problem.
The text was updated successfully, but these errors were encountered: