Skip to content

fix(plc4py/umas): resolve Python 3.12+ SyntaxWarnings in UmasTag#2535

Open
Abdylreshit wants to merge 1 commit into
apache:developfrom
Abdylreshit:fix/umas-tag-syntax-warnings
Open

fix(plc4py/umas): resolve Python 3.12+ SyntaxWarnings in UmasTag#2535
Abdylreshit wants to merge 1 commit into
apache:developfrom
Abdylreshit:fix/umas-tag-syntax-warnings

Conversation

@Abdylreshit

Copy link
Copy Markdown

Summary

Fixes three SyntaxWarning messages emitted by Python 3.12+ in plc4py/drivers/umas/UmasTag.py:

  1. Invalid escape sequence \[ in the regex _ADDRESS_PATTERN — converted the string literal to a raw string.
  2. Two occurrences of len(...) is not 0 — replaced with != 0. Comparing int with is/is not is unreliable (works only by CPython small-int caching) and the behavior is deprecated.

Test plan

  • pytest passes (77 passed, 36 xfailed — same as before, now with 0 warnings)
  • No behavioral changes — both fixes are semantics-preserving

- Use raw string for regex pattern (fixes invalid escape sequence '\[')
- Replace 'is not 0' with '!= 0' for int comparison
@chrisdutz

Copy link
Copy Markdown
Contributor

Any of the python folks able and willing to have a look? @ottlukas @hutcheb ?

@sruehl
sruehl requested review from hutcheb and ottlukas July 9, 2026 05:15
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.

2 participants