GTlab crashes when calling GtCalculators.findGtTask() from an external script file · Issue #568 · dlr-gtlab/python-module · GitHub
Skip to content

GTlab crashes when calling GtCalculators.findGtTask() from an external script file #568

Description

@marvinoe21

When calling the GtCalculators.findGtTask() function from an external script file, GTlab crashes unexpectedly.

Steps to Reproduce

  1. Start GTlab version 2.0.10 and ensure that the GTlab Python Module 1.6.0 is loaded.
  2. Create a directory named python_scripts in the same directory as GTlab.exe.
  3. In the python_scripts directory, create a Python script named external_script.py that calls GtCalculators.findGtTask(). Here is an example code to copy:
from GtCalculators import findGtTask

def external_find_task(task_name: str):
    task = findGtTask(task_name)
  1. In GTlab create a Simple Task named Task.
  2. Create a Python Task and copy the following code into it:
import os
import sys

external_scripts_dir = os.path.join(os.getcwd(), 'python_scripts')
sys.path.append(external_scripts_dir)

# Load the external module
from external_script import external_find_task
del sys.modules['external_script']
from external_script import external_find_task

external_find_task('Task')
  1. Run the script and observe that GTlab crashes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions