This repository was archived by the owner on Jul 22, 2023. It is now read-only.
forked frompythonnet/pythonnet
- Notifications
You must be signed in to change notification settings - Fork0
Commit7fcf401
authored
Fix crash "Name must not be empty!" (pythonnet#182) (pythonnet#230)
Not sure why PythonNet was getting this exception. Running my module with `python -m mymodule` would work fine. Anyways, I debugged a bit and the attached change fixed my issue.Please note this is a quick hack, just to keep my project going and it worked. I have no idea of the underlying cause and do not want to investigate but if you think my change is not risky you may want to merge as it does fix this issue (or at least hides the issue).A quick [Google](https://www.google.com.au/search?num=100&q="Name+must+not+be+empty%21"+PythonNet) shows that I'm not the first to get this exception.Exception Details:```System.ArgumentException: Name must not be empty! at Python.Runtime.ModuleObject..ctor(String name) in c:\dev\libs\pythonnet\src\runtime\moduleobject.cs:line 36 at Python.Runtime.ModuleObject.GetAttribute(String name, Boolean guess) in c:\dev\libs\pythonnet\src\runtime\moduleobject.cs:line 104 at Python.Runtime.ImportHook.__import__(IntPtr self, IntPtr args, IntPtr kw) in c:\dev\libs\pythonnet\src\runtime\importhook.cs:line 301 at Python.Runtime.Runtime.PyObject_Call(IntPtr pointer, IntPtr args, IntPtr kw) at Python.Runtime.ImportHook.__import__(IntPtr self, IntPtr args, IntPtr kw) in c:\dev\libs\pythonnet\src\runtime\importhook.cs:line 230 at Python.Runtime.Runtime.PyObject_Call(IntPtr pointer, IntPtr args, IntPtr kw) at Python.Runtime.ImportHook.__import__(IntPtr self, IntPtr args, IntPtr kw) in c:\dev\libs\pythonnet\src\runtime\importhook.cs:line 230 at Python.Runtime.Runtime.PyObject_Call(IntPtr pointer, IntPtr args, IntPtr kw) at Python.Runtime.ImportHook.__import__(IntPtr self, IntPtr args, IntPtr kw) in c:\dev\libs\pythonnet\src\runtime\importhook.cs:line 230 at Python.Runtime.Runtime.PyObject_Call(IntPtr pointer, IntPtr args, IntPtr kw) at Python.Runtime.ImportHook.__import__(IntPtr self, IntPtr args, IntPtr kw) in c:\dev\libs\pythonnet\src\runtime\importhook.cs:line 230 at Python.Runtime.Runtime.PyObject_Call(IntPtr pointer, IntPtr args, IntPtr kw) at Python.Runtime.ImportHook.__import__(IntPtr self, IntPtr args, IntPtr kw) in c:\dev\libs\pythonnet\src\runtime\importhook.cs:line 230 at Python.Runtime.Runtime.PyObject_Call(IntPtr pointer, IntPtr args, IntPtr kw) at Python.Runtime.ImportHook.__import__(IntPtr self, IntPtr args, IntPtr kw) in c:\dev\libs\pythonnet\src\runtime\importhook.cs:line 230 at Python.Runtime.Runtime.PyImport_ImportModule(String name) at Python.Runtime.PythonEngine.ImportModule(String name) in c:\dev\libs\pythonnet\src\runtime\pythonengine.cs:line 361```1 parent72366c6 commit7fcf401
1 file changed
+1
-2
lines changedLines changed: 1 addition & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
399 | 399 |
| |
400 | 400 |
| |
401 | 401 |
| |
402 |
| - | |
403 |
| - | |
| 402 | + | |
404 | 403 |
| |
405 | 404 |
| |
406 | 405 |
| |
|
0 commit comments
Comments
(0)