AcademySoftwareFoundation / AcademySoftwareFoundation/OpenRV

Error on using 'export_utils' in rv.runtime.eval when not loaded in call explicitly prior to it.

Open
#1,203 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
C++
Stars
764
Forks
246
Avg merge
6d 12h
Merged PRs (30d)
13

Description

### What happened?

I'm a bit confused by some behavior when using `rv.runtime.eval` with the [`export_utils`](https://github.com/AcademySoftwareFoundation/OpenRV/blob/db74d2263322d2e8a66911086450e51d810108d9/src/lib/app/mu_rvui/export_utils.mu) module.

For sake of a simple example, take e.g.
```python
import rv
print(rv.runtime.eval('export_utils.tempSessionName("rv")', ["export_utils"]))
```
This would just error:
```python
Traceback (most recent call last):
File "", line 2, in
Exception: Exception thrown while calling runtime.eval
```

But if I run this prior:
```python
rv.runtime.eval('runtime.load_module("export_utils");', [])
```
Then suddenly everything is fine, and it prints the path of the temp session as well.

Why do I need this separate call first? And how can I run `export_utils` module directly in a single runtime eval regardless of whether I've previously enforced the load of the module?

### List all the operating systems versions where this is happening

Windows 11, OpenRV_3.0.0+f85b7da-win64

### On what computer hardware is this happening?

Nvidia Geforce RTX 4070 SUPER , 128 GB ram

### Relevant console log output

```shell
INFO: Traceback (most recent call last):
INFO: File "", line 2, in
INFO: Exception: Exception thrown while calling runtime.eval
```

### Environment variables

_No response_

### Extra information

_No response_

### Code of Conduct

- [x] I agree to follow this project's Code of Conduct

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the call through rv.runtime.eval with src/lib/app/mu_rvui/export_utils.mu and compare it with the preceding runtime.load_module("export_utils") call. Trace how the module argument is handled when the module has not already been loaded; done means the direct eval works in that state on the reported Windows environment.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.