Skip to content
This repository has been archived by the owner on Jun 9, 2020. It is now read-only.

ValueError: source code string cannot contain null bytes #93

Closed
joleroi opened this issue Jun 8, 2017 · 2 comments
Closed

ValueError: source code string cannot contain null bytes #93

joleroi opened this issue Jun 8, 2017 · 2 comments

Comments

@joleroi
Copy link

joleroi commented Jun 8, 2017

When I run this script

import numpy as np

@profile
def myadd(a, b):
    return a + b

for a,b in zip(np.arange(10), np.arange(10)):
    print(myadd(a,b))

on my machine with

python --version
Python 3.5.3 :: Continuum Analytics, Inc.

and

conda list line_profile
# packages in environment at <...>/Software/miniconda3/envs/headversions:
#
line_profiler             2.0                      py35_0

it fails with this traceback

kernprof -l python test.py
Wrote profile results to python.lprof
Traceback (most recent call last):
  File "/home/kingj/Software/miniconda3/envs/headversions/bin/kernprof", line 6, in <module>
    sys.exit(kernprof.main())
  File "/home/kingj/Software/miniconda3/envs/headversions/lib/python3.5/site-packages/kernprof.py", line 222, in main
    execfile(script_file, ns, ns)
  File "/home/kingj/Software/miniconda3/envs/headversions/lib/python3.5/site-packages/kernprof.py", line 35, in execfile
    exec_(compile(f.read(), filename, 'exec'), globals, locals)
ValueError: source code string cannot contain null bytes

Any idea what could cause this?

@rkern
Copy link
Owner

rkern commented Jun 8, 2017

kernprof -l test.py not kernprof -l python test.py

@rkern rkern closed this as completed Jun 8, 2017
@joleroi
Copy link
Author

joleroi commented Jun 9, 2017

🙈

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants