Skip to content

Commit eae0160

Browse files
gijzelaerrclaude
andcommitted
Suppress misleading "not found" log when version was captured
After 0c9af7c the parser kept scanning past the SERVER_SESSION_VERSION attribute (so it could also grab ObjectVariableTypeName for the V2 legitimation), which made the trailing "ServerSessionVersion not found" debug fire on every successful capture. Gate it on the captured fields so it only fires when we actually didn't find it. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent a2111e7 commit eae0160

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

s7/connection.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -990,7 +990,8 @@ def _parse_create_object_response(self, payload: bytes) -> None:
990990
# Unknown tag - try to skip
991991
offset += 1
992992

993-
logger.debug("ServerSessionVersion not found in CreateObject response")
993+
if self._server_session_version_raw is None and self._server_session_version is None:
994+
logger.debug("ServerSessionVersion not found in CreateObject response")
994995

995996
def _skip_typed_value(self, data: bytes, offset: int, datatype: int, flags: int) -> int:
996997
"""Skip over a typed value in the PObject tree.

0 commit comments

Comments
 (0)