IronLanguages / IronLanguages/ironpython3
Using IronPython shell from GNU Emacs doesn't work
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 2.8k
- Forks
- 316
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 1
Description
Prerequisites
Confirmed is an error not a question.
- Are you running the latest version?
- Are you reporting to the correct repository?
- Did you perform a cursory search?
Description
I'm triying to run IronPython 3.4.1 (ipy.exe) as my python interpreter inside GNU Emacs 28.2 (build 2, x86_64-w64-mingw32), but it doesn't work. The original cpython interpreter, from the cygwin package, does work, ironpython 3.0.0 from the mono project installer also works.
Steps to Reproduce
To reproduce this error:
- Run GNU Emacs 28.2 having the python-mode 20221008.1936 installed.
- Run the M-x
customizecommand and search for the Python Shell Interpreter variable. - Put the ipy.exe full path on the variable and save it for the current session and future sessions.
- Run the M-x
run-pythoncommand to ask emacs for a python shell.
Expected behavior:
It should show the ironpython shell and let me work on it as an older version that comes from the mono project does:
Or as the cpython interpreter that comes from cygwin does:
Actual behavior:
Emacs tries to execute the interpreter but enters on some kind of infinite loop repeating "OSError: [Errno 9] The handle is invalid." until it is stopped either through the task manager or via the C-c C-c key combo:
Also i don't understand why emacs opens 2 sub-process of ironpython, maybe related to the error:
Version Information
Result of ipy -VV:
$ ipy -VV
IronPython 3.4.1 (3.4.1.1000)
[.NETFramework,Version=v4.6.2 on .NET Framework 4.8.4645.0 (64-bit)]
.NET platform used:
$ dotnet --info
.NET SDK (reflecting any global.json):
Version: 6.0.302
Commit: c857713418
Runtime Environment:
OS Name: Windows
OS Version: 10.0.19044
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\6.0.302\
global.json file:
Not found
Host:
Version: 6.0.7
Architecture: x64
Commit: 0ec02c8c96
.NET SDKs installed:
5.0.416 [C:\Program Files\dotnet\sdk]
6.0.302 [C:\Program Files\dotnet\sdk]
.NET runtimes installed:
Microsoft.AspNetCore.App 3.1.32 [C:\Program Files\dotnet\shared\Microsoft.AspN
etCore.App]
Microsoft.AspNetCore.App 5.0.17 [C:\Program Files\dotnet\shared\Microsoft.AspN
etCore.App]
Microsoft.AspNetCore.App 6.0.7 [C:\Program Files\dotnet\shared\Microsoft.AspNe
tCore.App]
Microsoft.NETCore.App 3.1.32 [C:\Program Files\dotnet\shared\Microsoft.NETCore
.App]
Microsoft.NETCore.App 5.0.17 [C:\Program Files\dotnet\shared\Microsoft.NETCore
.App]
Microsoft.NETCore.App 6.0.7 [C:\Program Files\dotnet\shared\Microsoft.NETCore.
App]
Microsoft.WindowsDesktop.App 3.1.32 [C:\Program Files\dotnet\shared\Microsoft.
WindowsDesktop.App]
Microsoft.WindowsDesktop.App 5.0.17 [C:\Program Files\dotnet\shared\Microsoft.
WindowsDesktop.App]
Microsoft.WindowsDesktop.App 6.0.7 [C:\Program Files\dotnet\shared\Microsoft.W
indowsDesktop.App]
Download .NET:
https://aka.ms/dotnet-download
Learn about .NET Runtimes and SDKs:
https://aka.ms/dotnet/runtimes-sdk-info
Operating system used:
Windows 10 Professional Version 21H2 OS build 19044.3324
sys.version:
$ ipy
IronPython 3.4.1 (3.4.1.1000)
[.NETFramework,Version=v4.6.2 on .NET Framework 4.8.4645.0 (64-bit)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.version
'3.4.1 (3.4.1.1000)\n[.NETFramework,Version=v4.6.2 on .NET Framework 4.8.4645.0
(64-bit)]'
As I'm comparing against the ironpython 3.0.0 that comes with mono here I include the version:
$ mono --version
Mono JIT compiler version 6.12.0 (Visual Studio built mono)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-proj
ect.com
TLS: __thread
SIGSEGV: normal
Notification: Thread + polling
Architecture: amd64
Disabled: none
Misc: softdebug
Interpreter: yes
LLVM: supported, not enabled.
Suspend: preemptive
GC: sgen (concurrent by default)
Also I'm comparing against the cpython interpreter from cygwin, here I include the cygwin version:
$ uname -a
CYGWIN_NT-10.0-19044 DTI-6005-66 3.3.6-341.x86_64 2022-09-05 11:15 UTC x86_64 Cygwin
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the failure with ipy.exe configured as the Python Shell Interpreter in GNU Emacs 28.2, then compare its behavior with the working CPython and IronPython 3.0.0 setups described in the issue. Investigate the repeated "OSError: [Errno 9] The handle is invalid" and the two subprocesses; done means run-python opens a usable IronPython shell without the loop.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- emacs, python
- Domain
- developer-experience
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100