pythonpyc

How to decompile pyc to py on Python 3.9?


I want to decompile PYC file in Python 3.9. I tried decompyle3, uncompyle6, but output was like this:

Error: decompyle3 requires Python 3.7-3.8

What I should use?


Solution

  • If you really have to support 3.9, you're going to have to do it yourself.

    Clone the repo locally, Change the line which requires 3.7-8, have a go, and fix it where it starts breaking (and do submit a PR when you're done). The changes between 3.8 and 3.9 are not enormous, so it likely won't be too much work. If the code you're trying to decompile is <3.9 anyway, you won't actually have to implement 3.9isms, so it may run straight off---code written in 3.8 will likely run in 3.9, as AFAIK the APIs haven't changed noticeable. I haven't looked at how compiling works, though, so I could be wrong.