Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@markjmiller
Copy link
Contributor

Closes #2302

Using the example in the linked issue, the problem in the current logic is that self.script_binding[1] contains kv's like:

{
    ...,
    'Foo': <class 'openc3.utilities.running_script.Foo'>,
    'foo': <openc3.utilities.running_script.Foo object at 0xffff97102990>,
    'baz': 123
}

The print is added and the statement eval'd only if the debug_text is directly found as a key in that dict. So foo will print, baz with print after baz = foo.bar, but foo.bar is not a dict key and therefore will not eval. By splitting the debug_text by dot and taking the first element, that at least checks if the base instance variable exists.

If you try foo.baz (an attribute that doesn't exist), you get AttributeError : 'Foo' object has no attribute 'baz' which is useful and expected.

Validation

Following the same repro steps, you can now type foo.bar and it will correctly eval to 123:

image

@sonarqubecloud
Copy link

@codecov
Copy link

codecov bot commented Sep 20, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.87%. Comparing base (9efbeb6) to head (99c8f36).
⚠️ Report is 6 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2367      +/-   ##
==========================================
- Coverage   79.88%   79.87%   -0.02%     
==========================================
  Files         654      654              
  Lines       48766    48766              
  Branches      741      741              
==========================================
- Hits        38956    38950       -6     
- Misses       9728     9734       +6     
  Partials       82       82              
Flag Coverage Δ
python 82.88% <ø> (-0.04%) ⬇️
ruby-api 84.65% <ø> (-0.06%) ⬇️
ruby-backend 82.71% <ø> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@jmthomas
Copy link
Member

Nice easy solution, thanks!

@jmthomas jmthomas merged commit 25fc38c into OpenC3:main Sep 22, 2025
29 of 30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Script runner debugger can't print object properties directly

2 participants