Closed rixx closed 2 years ago
Running on Python 3.5.1 and found the same error message:
os.chmod(tmp.name, 0666)
@rakhmad, that issue is solved when you check out my branch over at https://github.com/rixx/lptrace/tree/python3.
@rixx You were really close to getting this working. You just only missing the escape characters around the "r"
parameter, like so: cmd = 'exec(open(\\"{}\\", \\"r\\").read())'.format(name)
.
I created a version that runs on both python2 and python3 based on @nimble0's changes https://github.com/khamidou/lptrace/pull/15
I haven't gotten the script to work with Python3 yet. Things I did so far:
0o666
instead of0666
cmd = 'exec(open(\\"{}\\", "r").read())'.format(name)
because Python3 doesn't haveexecfile
tmp.write(script.encode())
due to bytes/string conversionI'm guessing that I'm either screwing up with bytes/strings/file reads or the Python3 interface differs in a way that doesn't raise an exception explaining the problem. Anybody with an insight here?