-
Couldn't load subscription status.
- Fork 413
Description
Describe the bug
The dot in the BrowseName gets lost when calling get_child(string) instead of get_child(list). This issue did not exist in asyncua version 1.0.1.
To Reproduce
file_node = await drive.get_child(["1:OpcUaDemo.h"]) # that works
file_node = await drive.get_child("1:OpcUaDemo.h") # that does'nt
Expected behavior
When I want to retrieve a node from the current level, the BrowseName should be allowed either as a string or as a list containing a single string element. Otherwise, backward compatibility between asyncua version 1.1.8 and 1.0.1 is broken.
Screenshots
Here is an excerpt from the asyncua logging:
- The good case with get_child("[1:OpcUaDemo.h]") called
DEBUG:asyncua.client.ua_client.UaClient:translate_browsepath_to_nodeid
DEBUG:asyncua.client.ua_client.UASocketProtocol:Sending: TranslateBrowsePathsToNodeIdsRequest(TypeId=FourByteNodeId(Identifier=554, NamespaceIndex=0, NodeIdType=<NodeIdType.FourByte: 1>), RequestHeader_=RequestHeader(AuthenticationToken=NodeId(Identifier=b'\x85\xecviy\xcc\xd4\xf7\xb4\x9e\xff\x80b\xfd.l\xfc\x8cD\x95O\x1e\x02\xc4\xa80\xa1[\xf0\x01', NamespaceIndex=0, NodeIdType=<NodeIdType.ByteString: 5>), Timestamp=datetime.datetime(2025, 10, 9, 13, 57, 7, 649159, tzinfo=datetime.timezone.utc), RequestHandle=8, ReturnDiagnostics=0, AuditEntryId=None, TimeoutHint=4000, AdditionalHeader=ExtensionObject(TypeId=NodeId(Identifier=0, NamespaceIndex=0, NodeIdType=<NodeIdType.TwoByte: 0>), Body=None)), Parameters=TranslateBrowsePathsToNodeIdsParameters(BrowsePaths=[BrowsePath(StartingNode=NodeId(Identifier=57002, NamespaceIndex=1, NodeIdType=<NodeIdType.FourByte: 1>), RelativePath_=RelativePath(Elements=[RelativePathElement(ReferenceTypeId=TwoByteNodeId(Identifier=33, NamespaceIndex=0, NodeIdType=<NodeIdType.TwoByte: 0>), IsInverse=False, IncludeSubtypes=True, TargetName=QualifiedName(NamespaceIndex=1, Name='OpcUaDemo.h'))]))]))
DEBUG:asyncua.client.ua_client.UaClient:TranslateBrowsePathsToNodeIdsResponse(TypeId=NodeId(Identifier=557, NamespaceIndex=0, NodeIdType=<NodeIdType.FourByte: 1>), ResponseHeader_=ResponseHeader(Timestamp=datetime.datetime(2025, 10, 9, 13, 57, 7, 686142, tzinfo=datetime.timezone.utc), RequestHandle=8, ServiceResult=StatusCode(value=0), ServiceDiagnostics=DiagnosticInfo(SymbolicId=None, NamespaceURI=None, Locale=None, LocalizedText=None, AdditionalInfo=None, InnerStatusCode=None, InnerDiagnosticInfo=None), StringTable=None, AdditionalHeader=ExtensionObject(TypeId=NodeId(Identifier=0, NamespaceIndex=0, NodeIdType=<NodeIdType.TwoByte: 0>), Body=None)), Results=[BrowsePathResult(StatusCode_=StatusCode(value=0), Targets=[BrowsePathTarget(TargetId=NodeId(Identifier=300010, NamespaceIndex=1, NodeIdType=<NodeIdType.Numeric: 2>), RemainingPathIndex=4294967295)])], DiagnosticInfos=None)
ns=1;i=300010
- The bad case with get_child("1:OpcUaDemo.h") called
DEBUG:asyncua.client.ua_client.UaClient:translate_browsepath_to_nodeid
DEBUG:asyncua.client.ua_client.UASocketProtocol:Sending: TranslateBrowsePathsToNodeIdsRequest(TypeId=FourByteNodeId(Identifier=554, NamespaceIndex=0, NodeIdType=<NodeIdType.FourByte: 1>), RequestHeader_=RequestHeader(AuthenticationToken=NodeId(Identifier=b'\x85\xecviy\xcc\xd4\xf7\xb4\x9e\xff\x80b\xfd.l\xfc\x8cD\x95O\x1e\x02\xc4\xa80\xa1[\xf0\x01', NamespaceIndex=0, NodeIdType=<NodeIdType.ByteString: 5>), Timestamp=datetime.datetime(2025, 10, 9, 13, 57, 7, 658432, tzinfo=datetime.timezone.utc), RequestHandle=9, ReturnDiagnostics=0, AuditEntryId=None, TimeoutHint=4000, AdditionalHeader=ExtensionObject(TypeId=NodeId(Identifier=0, NamespaceIndex=0, NodeIdType=<NodeIdType.TwoByte: 0>), Body=None)), Parameters=TranslateBrowsePathsToNodeIdsParameters(BrowsePaths=[BrowsePath(StartingNode=NodeId(Identifier=57002, NamespaceIndex=1, NodeIdType=<NodeIdType.FourByte: 1>), RelativePath_=RelativePath(Elements=[RelativePathElement(ReferenceTypeId=NodeId(Identifier=33, NamespaceIndex=0, NodeIdType=<NodeIdType.TwoByte: 0>), IsInverse=False, IncludeSubtypes=True, TargetName=QualifiedName(NamespaceIndex=1, Name='OpcUaDemo')), RelativePathElement(ReferenceTypeId=NodeId(Identifier=44, NamespaceIndex=0, NodeIdType=<NodeIdType.TwoByte: 0>), IsInverse=False, IncludeSubtypes=True, TargetName=QualifiedName(NamespaceIndex=0, Name='h'))]))]))
DEBUG:asyncua.client.ua_client.UaClient:TranslateBrowsePathsToNodeIdsResponse(TypeId=NodeId(Identifier=557, NamespaceIndex=0, NodeIdType=<NodeIdType.FourByte: 1>), ResponseHeader_=ResponseHeader(Timestamp=datetime.datetime(2025, 10, 9, 13, 57, 7, 716849, tzinfo=datetime.timezone.utc), RequestHandle=9, ServiceResult=StatusCode(value=0), ServiceDiagnostics=DiagnosticInfo(SymbolicId=None, NamespaceURI=None, Locale=None, LocalizedText=None, AdditionalInfo=None, InnerStatusCode=None, InnerDiagnosticInfo=None), StringTable=None, AdditionalHeader=ExtensionObject(TypeId=NodeId(Identifier=0, NamespaceIndex=0, NodeIdType=<NodeIdType.TwoByte: 0>), Body=None)), Results=[BrowsePathResult(StatusCode_=StatusCode(value=2154758144), Targets=[])], DiagnosticInfos=None)
Version
Python-Version: 3.13.7 (tags/v3.13.7:bcee1c3, Aug 14 2025, 14:15:11) [MSC v.1944 64 bit (AMD64)]
opcua-asyncio Version (e.g. master branch, 0.9): master branch 1.1.8