I am writing a test that is intended to mutate binary data and ensure that my program can read the variations. Null bytes are an important part of this binary protocol.
When I try to save it, however, I encounter the error:
ValueError: source code string cannot contain null bytes
The assignment I'm currently trying is:
binary_blob = rb"""<value>"""
Where <value>
has the hex representation 0x00
.
How can I modify the assignment to avoid this error? I am using Python 3.9.5.