Python: source code string cannot contain null bytes
I am using Visual Studio Code, the encoding was set to UTF-16 LE. You can check the encoding on the right bottom side of VSCode. Just click on the encoding and select "save with encoding" and select UTF-8. It worked perfectly.
For posterity: I had the same problem and fixed it using,
sed -i 's/\x0//g' FILENAME
The file seemed to be messed up in numerous ways (wrong endings, etc); no idea how...
See https://stackoverflow.com/a/2399817/230468