Skip to content

fix: symbol info for function block properties with monitoring = call (#261)#529

Merged
stlehmann merged 6 commits into
masterfrom
property_access
Jun 7, 2026
Merged

fix: symbol info for function block properties with monitoring = call (#261)#529
stlehmann merged 6 commits into
masterfrom
property_access

Conversation

@stlehmann

Copy link
Copy Markdown
Owner

Fixes #261.

Replaces #512, which was based on a much older version of master.
This branch is a rebase of dgl-cw's original fix with three
improvements applied on top:

  • Replace magic constant 0xF019 with named ADSIGRP_SYM_FB_PROP_CALL
    in constants.py
  • Track handle acquisition with an _acquired_handle flag so __del__
    only calls release_handle() for symbols where get_handle() was
    actually called internally (avoids a false positive on any symbol that
    happens to use ADSIGRP_SYM_VALBYHND)
  • Inherit master's existing try/except ADSError guard in __del__
    via rebase (same class of fix as CI: Fix Segmentation error on module shutdown #528)

dgl-cw and others added 3 commits June 7, 2026 21:33
…P_CALL

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…_del__

index_group == ADSIGRP_SYM_VALBYHND is true for any symbol using that access
method, not just ones where get_handle() was called internally. The flag
precisely tracks whether release_handle() is required on destruction.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@coveralls

coveralls commented Jun 7, 2026

Copy link
Copy Markdown

Coverage Report for CI Build 27102973098

Coverage increased (+0.2%) to 93.575%

Details

  • Coverage increased (+0.2%) from the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • 12 coverage regressions across 6 files.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

12 previously-covered lines in 6 files lost coverage.

File Lines Losing Coverage Coverage
/opt/hostedtoolcache/Python/3.10.20/x64/lib/python3.10/site-packages/pyads/symbol.py 2 98.71%
/opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/pyads/symbol.py 2 98.71%
/opt/hostedtoolcache/Python/3.12.13/x64/lib/python3.12/site-packages/pyads/symbol.py 2 98.71%
/opt/hostedtoolcache/Python/3.13.13/x64/lib/python3.13/site-packages/pyads/symbol.py 2 98.71%
/opt/hostedtoolcache/Python/3.14.5/x64/lib/python3.14/site-packages/pyads/symbol.py 2 98.71%
/opt/hostedtoolcache/Python/3.9.25/x64/lib/python3.9/site-packages/pyads/symbol.py 2 98.71%

Coverage Stats

Coverage Status
Relevant Lines: 11580
Covered Lines: 10836
Line Coverage: 93.58%
Coverage Strength: 0.94 hits per line

💛 - Coveralls

stlehmann and others added 3 commits June 7, 2026 21:42
Mirrors the existing try/except around clear_device_notifications().
If the connection is gone at GC time (e.g. interpreter shutdown, same
class of problem fixed in #528), release_handle() would raise and
produce an unraisable exception in the destructor.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Covers four scenarios using mocked adsGetSymbolInfo:
- iGroup=0xF019 causes get_handle() and ADSIGRP_SYM_VALBYHND
- normal symbols use offset directly, no handle acquired
- handle is released via release_handle() on destruction
- ADSError from release_handle() in __del__ is suppressed

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@stlehmann stlehmann merged commit b5d4a4e into master Jun 7, 2026
8 checks passed
@stlehmann stlehmann deleted the property_access branch June 7, 2026 19:57
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.

Support for monitored properties

3 participants