GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Unhandled Exception when exiting from nPython.exe (net472) · Issue #2348 · pythonnet/pythonnet

Unhandled Exception when exiting from nPython.exe (net472) #2348

New issue
Copy link
New issue
Copy link
Closed
Closed
Unhandled Exception when exiting from nPython.exe (net472)#2348
Copy link
Labels
bug

Description

@xiazeyi
xiazeyi
opened on Mar 22, 2024
Issue body actions

Environment

  • Pythonnet version: 3.0.3
  • Python version: 3.11.5
  • Operating System: Windows 10
  • .NET Runtime:

Details

  • Download source code from https://github.com/pythonnet/pythonnet/releases/tag/v3.0.3
  • Build the console with VS 2022
  • Set PYTHONNET_PYDLL=python311.dll (Python 3.11.5 is installed)
  • Run nPython.exe in net472
  • Input quit() and press Return to exit
C:\pythonnet-3.0.3\net472>nPython.exe
Python 3.11.5 (tags/v3.11.5:cce6ba9, Aug 24 2023, 14:38:34) [MSC v.1936 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> quit()

Unhandled Exception: System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
   at Python.Runtime.Runtime.PyGILState_Ensure()
   at Python.Runtime.Py.GIL()
   at Python.Runtime.PythonEngine.Shutdown()

Unhandled Exception: System.InvalidOperationException: GIL must always be released, and it must be released from the same thread that acquired it.
   at Python.Runtime.Py.GILState.Finalize()
  • Run nPython.exe in net472
  • Input Ctrl + Z and press Return to exit
C:\pythonnet-3.0.3\net472>nPython.exe
Python 3.11.5 (tags/v3.11.5:cce6ba9, Aug 24 2023, 14:38:34) [MSC v.1936 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> ^Z


Unhandled Exception: System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
   at Python.Runtime.Runtime.PyGILState_Ensure() in C:\pythonnet-3.0.3.tar\pythonnet-3.0.3\src\runtime\Runtime.cs:line 705
   at Python.Runtime.Py.GIL() in C:\pythonnet-3.0.3.tar\pythonnet-3.0.3\src\runtime\Py.cs:line 13
   at Python.Runtime.PythonEngine.Shutdown() in C:\pythonnet-3.0.3.tar\pythonnet-3.0.3\src\runtime\PythonEngine.cs:line 397
   at Python.Runtime.PythonConsole.Main(String[] args) in C:\pythonnet-3.0.3.tar\pythonnet-3.0.3\src\console\pythonconsole.cs:line 40

Activity

  1. filmor commented on Apr 27, 2024

    @filmor
    filmor
    on Apr 27, 2024
    Member
    More actions

    Seems to happen on Mono as well, but not on .NET Core.

  2. filmor
    added
    bug
    on Aug 22, 2024
  3. lostmsu
    closed this as completedon Apr 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.