Skip to content

fix: use _len instead of _length in Array.decode range()#337

Open
AmSach wants to merge 1 commit into
ottowayi:masterfrom
AmSach:fix/cip-array-type-decode
Open

fix: use _len instead of _length in Array.decode range()#337
AmSach wants to merge 1 commit into
ottowayi:masterfrom
AmSach:fix/cip-array-type-decode

Conversation

@AmSach

@AmSach AmSach commented May 31, 2026

Copy link
Copy Markdown

Fixed the bug described in issue #336.

The decode method for CIP Array types was using _length instead of _len in the range() call, which resulted in the error: TypeError: _DataTypeMeta object cannot be interpreted as an integer when decoding array types like Array(UINT, ActiveLanguage).

Root cause: Line 872 used _length (which can be a DataType meta object) instead of _len (the decoded integer value) when iterating over array elements.

Fix: Changed range(_length) to range(_len).

Fixes #336

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.

[BUG] - Cip Array Type decode method fails

1 participant