IronPython stops to work with module (json) after a while
See original GitHub issuePython 2.7.11 on .NET Core 3.1 hosted in Azure on service fabric. Initially everything works, after a while a certain library fails, namely json
{
"ClassName": "System.MissingMemberException",
"Message": "'module' object has no attribute 'dumps'",
"Data": null,
"InnerException": null,
"HelpURL": null,
"StackTraceString": " at IronPython.Runtime.Operations.PythonOps.ObjectGetAttribute(CodeContext context, Object o, String name)\r\n at IronPython.Runtime.PythonModule.__getattribute__(CodeContext context, String name)\r\n at System.Dynamic.UpdateDelegates.UpdateAndExecute2[T0,T1,TRet](CallSite site, T0 arg0, T1 arg1)\r\n at Microsoft.Scripting.Interpreter.FuncCallInstruction`5.Run(InterpretedFrame frame)\r\n at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)\r\n at Microsoft.Scripting.Interpreter.LightLambda.Run2[T0,T1,TRet](T0 arg0, T1 arg1)\r\n at IronPython.Compiler.PythonScriptCode.RunWorker(CodeContext ctx)\r\n at Ic.RestMocker.Core.Scripting.ScriptSession.Execute(String script, Dictionary`2 scope) in I:\\agent\\_work\\817\\s\\Ic.RestMocker.Core\\Scripting\\ScriptSession.cs:line 93\r\n at Ic.RestMocker.Core.Controllers.ScriptsController.Post() in I:\\agent\\_work\\817\\s\\Ic.RestMocker.Core\\Controllers\\ScriptsController.cs:line 38",
"RemoteStackTraceString": null,
"RemoteStackIndex": 0,
"ExceptionMethod": null,
"HResult": -2146233070,
"Source": "IronPython",
"WatsonBuckets": null,
"MMClassName": null,
"MMMemberName": null,
"MMSignature": null
}
If I create a script like
import sys
sys.path
Output is
[
"D:\\SvcFab\\_App\\RestMocker.ApplicationType_App66\\RestMocker.ApiPkg.Code.1.0.0.RestMocker_master_20201123.2\\pylib"
]
Which is the correct path to pylib
Issue Analytics
- State:
- Created 3 years ago
- Comments:16 (4 by maintainers)
Top Results From Across the Web
IronPython: No module named json - Stack Overflow
I soon discovered that the interactive python window in Visual Studio did not throw this error. print sys.path also showed different values ...
Read more >ironpython import module error | The Search Engine You Control
I am trying to run a Python script with Spacy NER model on C# using Dynamic Py. I used following C# source code:....
Read more >18.2. json — JSON encoder and decoder - IronPython
Extensible JSON encoder for Python data structures. Supports the following objects and types by default: Python, JSON. dict, object. list, ...
Read more >Python Multithreading and Multiprocessing Tutorial - Toptal
Threading is just one of the many ways concurrent programs can be built. In this article, we will take a look at threading...
Read more >No JSON object could be decoded - StartStopServices.py
I'm trying to run a python scrtipt to stop services, but I'm getting the following error message : "No JSON object could be...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
This is output from your commands btw, will test again when it breaks
@slozier
I have been able to repro! The total failure of the module only happens about 1 each 5 or 10 time for above test. So I rewrote my test to this, and now it fails every time
My solution