You need to go via the codecs
module and the hex_codec
codec (or its hex
alias if available*):
codecs.encode(b'\x12', 'hex_codec')
* From the documentation: “Changed in version 3.4: Restoration of the aliases for the binary transforms”.
You need to go via the codecs
module and the hex_codec
codec (or its hex
alias if available*):
codecs.encode(b'\x12', 'hex_codec')
* From the documentation: “Changed in version 3.4: Restoration of the aliases for the binary transforms”.