FreeOpcUa / opcua-asyncio

OPC UA library for python >= 3.7
GNU Lesser General Public License v3.0
1.04k stars 346 forks source link

Allow ByteString Variant to be None #1539

Closed ldet closed 6 months ago

ldet commented 6 months ago

Hello, while working with an open62541 based server, I encountered an empty/null ByteString. The ua_binary implementation of ByteString (_Bytes) already handles this case as per the standard (Part 6 5.2.2.7) and sets the value to None, but the implementation of Variant currently throws an UaError when a ByteString with value None is encountered. This PR adds ByteString to the allowed VariantTypes that can be None.