1

Context is that my Python 3.9 source code files were deleted.

Earlier, I forgot to add .gitignore in my repository root of my Python Django Project and I committed the code to my github repository. Now the root folder contains __pycache__, where all the compiled python files are located. I tried looking at, how to decompile the files and found the required resource uncompyle6 on PyPI. However, it works for Python 2.4 - 3.8. In addition, there is a Python decompiler decompyle3 for Python 3.7 - 3.8 which is stripped down from uncompyle6. But the version of Python I have been using all along is Python 3.9. Is there a way I can get around this and be able to solve my problem of decompiling my .py files anyhow so I can get the earlier project structure that I require?

Edit: unpyclib and Decompyle++ are another tools that I looked into, however both are Python 2.xx only programs. The most successful decompiler is uncompyle6(offering support upto Python 3.8 as of now) as is quite evident from several other responses on stackoverflow.

12
  • Have you tried to install them and run it? Are you getting error? Commented May 1, 2021 at 19:41
  • 2
    If you still have the source files, why do you need to decompile from __pychache__. I think I'm missing something here. Commented May 1, 2021 at 20:00
  • @joanis I actually don't. I dont have the source files. If I did, there was no point in trying to decompile __pycache__. I'd delete the code from the repository and commit the code all over again, which would be more convenient. Commented May 1, 2021 at 20:03
  • 2
    OK, sorry, that's what I misunderstood. This question makes more sense now. I would suggest editing the question to explicitly state that you no longer have the source code. Commented May 1, 2021 at 20:04
  • @TYZ Yes I did and decompyle3 throws the error: decompyle3 requires Python 3.7-3.8 Commented May 1, 2021 at 20:05

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.