byterun icon indicating copy to clipboard operation
byterun copied to clipboard

Does not support Python 3.6

Open Axure opened this issue 6 years ago • 4 comments

It throws IndexError: tuple index out of range.

Traceback (most recent call last):
  File "python.py", line 176, in <module>
    """)
  File "python.py", line 166, in exec_python
    vm_value = vm.run_code(code)
  File "/usr/lib/python3.6/site-packages/byterun/pyvm2.py", line 145, in run_code
    val = self.run_frame(frame)
  File "/usr/lib/python3.6/site-packages/byterun/pyvm2.py", line 318, in run_frame
    byteName, arguments, opoffset = self.parse_byte_and_args()
  File "/usr/lib/python3.6/site-packages/byterun/pyvm2.py", line 182, in parse_byte_and_args
    arg = f.f_code.co_consts[intArg]
IndexError: tuple index out of range

Actually, the intArg has become incredibly large, like 23040. I guess the format of the bytecode has changed.

Axure avatar Jul 26 '17 19:07 Axure

@Axure did you find any solution?

canorbal avatar Oct 23 '17 19:10 canorbal

Python 3.6 bytecode is very different. It uses two bytes for every instruction instead of a mix of one and three byte instructions. For more info on this change see: https://bugs.python.org/issue26647

llllllllll avatar Oct 23 '17 19:10 llllllllll

I am working on py36 support here: https://github.com/vrthra/byterun/tree/py36

The byte code changes are easily fixable (in the branch above), but adding new opcodes is taking time.

vrthra avatar Jan 30 '18 10:01 vrthra

@vrthra See https://github.com/rocky/x-python/blob/master/xpython/byteop/byteop35.py https://github.com/rocky/x-python/blob/master/xpython/byteop/byteop36.py and https://github.com/rocky/x-python/blob/master/xpython/byteop/byteop37.py for most of the new byteops. 3.5 WITH_CLEANUP_{START,FINISH} are half working, and some of the new async opcodes are lagging, but the most used new operations are in there.

rocky avatar May 07 '20 16:05 rocky