objectdictionary.__init__.ODVariable.encode_raw() converts native datatypes to bytes.
https://github.com/christiansandberg/canopen/blob/54ebbd45a8084f664c21be270fae0f7a1a658355/canopen/objectdictionary/__init__.py#L403-L404
What is the use-case for this logic? It means that when a value of bytes is passed, it will bypass the encoding and use the user provided bytes value rather than raising TypeError. Do you remember the intention @christiansandberg?
I'm currently working on adding the missing datatypes, and I encountered this code and is curious of its use case. The unittests pass if this is commented out, so we don't have a test case for it either.