Title: Unhandled Exception when exiting from nPython.exe (net472) · Issue #2348 · pythonnet/pythonnet · GitHub
Open Graph Title: Unhandled Exception when exiting from nPython.exe (net472) · Issue #2348 · pythonnet/pythonnet
X Title: Unhandled Exception when exiting from nPython.exe (net472) · Issue #2348 · pythonnet/pythonnet
Description: 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 PYTHON...
Open Graph Description: 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 B...
X Description: 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 B...
Opengraph URL: https://github.com/pythonnet/pythonnet/issues/2348
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Unhandled Exception when exiting from nPython.exe (net472)","articleBody":"### Environment\r\n\r\n- Pythonnet version: 3.0.3\r\n- Python version: 3.11.5\r\n- Operating System: Windows 10\r\n- .NET Runtime:\r\n\r\n### Details\r\n\r\n- Download source code from https://github.com/pythonnet/pythonnet/releases/tag/v3.0.3\r\n- Build the console with VS 2022\r\n- Set PYTHONNET_PYDLL=python311.dll (Python 3.11.5 is installed)\r\n- Run nPython.exe in net472\r\n- Input `quit()` and press Return to exit\r\n \r\n```\r\nC:\\pythonnet-3.0.3\\net472\u003enPython.exe\r\nPython 3.11.5 (tags/v3.11.5:cce6ba9, Aug 24 2023, 14:38:34) [MSC v.1936 64 bit (AMD64)] on win32\r\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\r\n\u003e\u003e\u003e quit()\r\n\r\nUnhandled Exception: System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.\r\n at Python.Runtime.Runtime.PyGILState_Ensure()\r\n at Python.Runtime.Py.GIL()\r\n at Python.Runtime.PythonEngine.Shutdown()\r\n\r\nUnhandled Exception: System.InvalidOperationException: GIL must always be released, and it must be released from the same thread that acquired it.\r\n at Python.Runtime.Py.GILState.Finalize()\r\n```\r\n\r\n- Run nPython.exe in net472\r\n- Input `Ctrl + Z` and press Return to exit\r\n\r\n```\r\nC:\\pythonnet-3.0.3\\net472\u003enPython.exe\r\nPython 3.11.5 (tags/v3.11.5:cce6ba9, Aug 24 2023, 14:38:34) [MSC v.1936 64 bit (AMD64)] on win32\r\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\r\n\u003e\u003e\u003e ^Z\r\n\r\n\r\nUnhandled Exception: System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.\r\n at Python.Runtime.Runtime.PyGILState_Ensure() in C:\\pythonnet-3.0.3.tar\\pythonnet-3.0.3\\src\\runtime\\Runtime.cs:line 705\r\n at Python.Runtime.Py.GIL() in C:\\pythonnet-3.0.3.tar\\pythonnet-3.0.3\\src\\runtime\\Py.cs:line 13\r\n at Python.Runtime.PythonEngine.Shutdown() in C:\\pythonnet-3.0.3.tar\\pythonnet-3.0.3\\src\\runtime\\PythonEngine.cs:line 397\r\n at Python.Runtime.PythonConsole.Main(String[] args) in C:\\pythonnet-3.0.3.tar\\pythonnet-3.0.3\\src\\console\\pythonconsole.cs:line 40\r\n```","author":{"url":"https://github.com/xiazeyi","@type":"Person","name":"xiazeyi"},"datePublished":"2024-03-22T02:29:03.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/2348/pythonnet/issues/2348"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:7bdbc162-1517-24fe-092c-215437a2ec74 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 99AC:2DE302:11533F7:184E22C:6970CCD3 |
| html-safe-nonce | bf528f45e4c9699ef958dabcffcaadba82e26aacf5843dda1f75156bb3457971 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5OUFDOjJERTMwMjoxMTUzM0Y3OjE4NEUyMkM6Njk3MENDRDMiLCJ2aXNpdG9yX2lkIjoiNDE5Mzg3NDU5OTUyODY4MDY1OSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 3333439b8c7e58bc95a4e90e7baf6ebb5ece8476b9c330ea4deea706308459a8 |
| hovercard-subject-tag | issue:2201551127 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/pythonnet/pythonnet/2348/issue_layout |
| twitter:image | https://opengraph.githubassets.com/9fb1218d4e396611d91d481e042ee0221cc7ff1a6c70ff1f7c6404407d068ba1/pythonnet/pythonnet/issues/2348 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/9fb1218d4e396611d91d481e042ee0221cc7ff1a6c70ff1f7c6404407d068ba1/pythonnet/pythonnet/issues/2348 |
| og:image:alt | 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 B... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | xiazeyi |
| hostname | github.com |
| expected-hostname | github.com |
| None | 721764876e433c894814212f8100f6610f1dde78a987acc2e385d8be8e170e9c |
| turbo-cache-control | no-preview |
| go-import | github.com/pythonnet/pythonnet git https://github.com/pythonnet/pythonnet.git |
| octolytics-dimension-user_id | 6050430 |
| octolytics-dimension-user_login | pythonnet |
| octolytics-dimension-repository_id | 14748123 |
| octolytics-dimension-repository_nwo | pythonnet/pythonnet |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 14748123 |
| octolytics-dimension-repository_network_root_nwo | pythonnet/pythonnet |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 6ff3d08f4ee1c3f89ebedf4df8fc8fe851190294 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width