During copy/pasting code I often get null
bytes in Python code. Python itself reports general error against module and doesn't specify location of null byte. IDE of my choice like PyCharm, doesn't have check for this and doesn't see null bytes in code.
So, what is the general way to find null
bytes in Python code?
λ cat main.py
import helloworld
λ cat helloworld.py
print('Hello world! ')
λ python main.py
Traceback (most recent call last):File "main.py", line 1, in <module>import helloworld
ValueError: source code string cannot contain null bytesλ python helloworld.pyFile "helloworld.py", line 1print('Hello world!^
SyntaxError: EOL while scanning string literalλ cat -A helloworld.py
print('Hello world!^@')