I would like to determine which version of python a pyc file was compiled with. I do not have access to the original py file. I already attempted the following based on the accepted answer to a similar question:
>>> f = open('pyc_file.pyc')
>>> magic = f.read(4)
However, in my case I get an error:
UnicodeDecodeError: 'charmap' codec can't decode byte 0x8d in position 433: character maps to undefined
Why does this error occur? How can I determine the correct version that the pyc file was compiled as?