khamidou / lptrace

Trace any Python program, anywhere!
http://khamidou.com/lptrace/
GNU General Public License v3.0
699 stars 43 forks source link

Python3 mode #4

Closed rixx closed 2 years ago

rixx commented 7 years ago

I haven't gotten the script to work with Python3 yet. Things I did so far:

I'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?

rakhmad commented 7 years ago

Running on Python 3.5.1 and found the same error message: os.chmod(tmp.name, 0666)

rixx commented 7 years ago

@rakhmad, that issue is solved when you check out my branch over at https://github.com/rixx/lptrace/tree/python3.

nimble0 commented 7 years ago

@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).

seppo0010 commented 6 years ago

I created a version that runs on both python2 and python3 based on @nimble0's changes https://github.com/khamidou/lptrace/pull/15