Cmd Line: kernprof -v ./simply.py.lprof
Some of the report is displayed and then this staacktrace below. I inserted a pdb.set_trace() in kernprof.py and the filename is correct and the file handle also.
Traceback (most recent call last):
File "/usr/bin/kernprof", line 11, in
load_entry_point('line-profiler==2.1.1', 'console_scripts', 'kernprof')()
File "/usr/local/google/home/rwh/.local/lib/python3.7/site-packages/kernprof.py", line 226, in main
prof.runctx('execfile_(%r, globals())' % (script_file,), ns, ns)
File "/usr/local/google/home/rwh/python/src/pyenv/versions/3.7.0/lib/python3.7/cProfile.py", line 100, in runctx
exec(cmd, globals, locals)
File "", line 1, in
File "/usr/local/google/home/rwh/.local/lib/python3.7/site-packages/kernprof.py", line 36, in execfile
with open(filename, 'rb') as f:
ValueError: source code string cannot contain null bytes
try:
execfile
except NameError:
# Python 3.x doesn't have 'execfile' builtin
import builtins
exec_ = getattr(builtins, "exec")
def execfile(filename, globals=None, locals=None):
pdb.set_trace()
with open(filename, 'rb') as f:
exec_(compile(f.read(), filename, 'exec'), globals, locals)
Cmd Line: kernprof -v ./simply.py.lprof
Some of the report is displayed and then this staacktrace below. I inserted a pdb.set_trace() in kernprof.py and the filename is correct and the file handle also.
Traceback (most recent call last):
File "/usr/bin/kernprof", line 11, in
load_entry_point('line-profiler==2.1.1', 'console_scripts', 'kernprof')()
File "/usr/local/google/home/rwh/.local/lib/python3.7/site-packages/kernprof.py", line 226, in main
prof.runctx('execfile_(%r, globals())' % (script_file,), ns, ns)
File "/usr/local/google/home/rwh/python/src/pyenv/versions/3.7.0/lib/python3.7/cProfile.py", line 100, in runctx
exec(cmd, globals, locals)
File "", line 1, in
File "/usr/local/google/home/rwh/.local/lib/python3.7/site-packages/kernprof.py", line 36, in execfile
with open(filename, 'rb') as f:
ValueError: source code string cannot contain null bytes
try:
execfile
except NameError:
# Python 3.x doesn't have 'execfile' builtin
import builtins
exec_ = getattr(builtins, "exec")