Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Unhandled exception. System.InvalidOperationException: GIL must always be released #2544

Copy link
Copy link
@tarunsk1998

Description

@tarunsk1998
Issue body actions

I have an dotnet application that uses pythonnet to invoke a python script.

I am facing the below issue while I am testing the application.

Error:
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()

There is another error printing in the logs:
error message: The type initializer for 'Delegates' threw an exception.

I am facing this issue for both python 3.11 and 3.12 versions.

Has anyone faced this issue or help me debug this issue?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.