./lang/py-uncompyle6, Python cross-version byte-code decompiler

[ CVSweb ] [ Homepage ] [ RSS ] [ Required by ] [ Add to tracker ]


Branch: CURRENT, Version: 3.7.1, Package name: py37-uncompyle6-3.7.1, Maintainer: pkgsrc-users

A native Python cross-version decompiler and fragment decompiler. The successor
to decompyle, uncompyle, and uncompyle2.

uncompyle6 translates Python bytecode back into equivalent Python source code.
It accepts bytecodes from Python version 1.3 to version 3.7, spanning over 22
years of Python releases. We include Dropbox's Python 2.5 bytecode and some
PyPy bytecode.


Required to run:
[devel/py-setuptools] [lang/python37] [lang/py-spark-parser] [devel/py-xdis]

Required to build:
[pkgtools/cwrappers]

Master sites:

SHA1: 861e5b634e07d10c993a1624d3fbc560d8fa9237
RMD160: 6c71d5aec5e31cf8caac8c696d6075019894a0a8
Filesize: 2322.719 KB

Version history: (Expand)


CVS history: (Expand)


   2020-06-20 18:23:16 by Adam Ciarcinski | Files touched by this commit (2) | Package updated
Log message:
py-uncompyle6: updated to 3.7.1

3.7.1:
Released to pick up new xdis version which has fixes to read bytestings better on 3.x
Handle 3.7+ "else" branch removal adAs seen in _cmp() of \ 
python3.8/distutils/version.py with optimization -O2
3.6+ "with" and "with .. as" grammar improvements
ast-check for "for" loop was missing some grammar rules
   2020-05-23 10:41:53 by Adam Ciarcinski | Files touched by this commit (2) | Package updated
Log message:
py-uncompyle6: updated to 3.7.0

3.7.0:
The main impetus for this release is to pull in the recent changes from xdis.
We simplify imports using xdis 4.6.0.
   2020-05-17 20:39:29 by Adam Ciarcinski | Files touched by this commit (3)
Log message:
pytest from versioned depends
   2020-04-28 13:03:22 by Adam Ciarcinski | Files touched by this commit (2) | Package updated
Log message:
py-uncompyle6: updated to 3.6.7

3.6.7:
xdis again

More upheaval in xdis which we need to track here.
   2020-04-22 22:49:07 by Adam Ciarcinski | Files touched by this commit (2) | Package updated
Log message:
py-uncompyle6: updated to 3.6.6

3.6.6: 2020-4-20 Love in the time of Cholera

The main reason for this release is an incompatablity bump in xdis which handles \ 
3.7 SipHash better.

Go over "yield" as an expression precidence
Some small alignment with code in decompyle3 for "or" and \ 
"and" was done
   2020-04-03 09:44:59 by Adam Ciarcinski | Files touched by this commit (2) | Package updated
Log message:
py-uncompyle6: updated to 3.6.5

3.6.5:
Back port some of the changes in decompile3 here which mostly helps 3.7 and 3.8 \ 
decompilation, although this may also help 3.6ish versions too.

Handle nested async for in for... and better async comprehension detection via \ 
xdis. Still more work is needed.
include token number in listings when -g and there is a parser error
remove unneeded Makefiles now that remake 4.3+1.5dbg is a thing that has -c
Bug in finding annotations in functions with docstrings
Fix bug found by 2.4 sre_parse.py testing
Fix transform module's ifelseif bugs
Fix bug in 3.0 name module detection
Fix docstring detection
   2020-03-16 00:35:03 by Adam Ciarcinski | Files touched by this commit (1)
Log message:
py-uncompyle6: fix PLIST for Python 2.7; note: and_not_check.py is not used at all
   2020-02-13 20:27:36 by Adam Ciarcinski | Files touched by this commit (3) | Package updated
Log message:
py-uncompyle6: updated to 3.6.4

3.6.4:
plateau

The main focus in this release was fix some of the more glaring problems creapt \ 
in from the last release due to that refactor.

uncompyle6 code is at a plateau where what is most needed is a code refactoring. \ 
In doing this, until everything refactored and replaced, decomplation may get \ 
worse.

Therefore, this release largely serves as a checkpoint before more major upheaval.

The upheaval, in started last release, I believe the pinnicle was around c90ff51 \ 
which wasn't a release. I suppose I should tag that.

After c90ff5, I started down the road of redoing control flow in a more \ 
comprehensible, debuggable, and scalable way. See The Control Flow Mess.

The bulk of the refactoring going on in the decompyle3 project, but I try to \ 
trickle down the changes.

It is tricky because the changes are large and I have to figure decompose things \ 
so that little testable pieces can be done. And there is also the problem that \ 
what is in decompyle3 is incomplete as well.

Other than control flow, another change that will probably happen in the next \ 
release is to redo the grammar for lambda expressions. Right now, we treat them \ 
as Python statements, you know, things with compound statements in them. But \ 
lambdas aren't that. And so there is hackery to paper over difference making a \ 
statement out of an expression the wrong thing to do. For example, a return of \ 
an "and" expression can be expressed as nested "if" \ 
statements with return inside them, but the "if" variant of the \ 
bytecode is not valid in a lambda.

In the decompyle3 code, I've gone down the road making the grammar goal symbol \ 
be an expression. This also offers the opportunity to split the grammar making \ 
parsing inside lambda not only more reliable because the wrong choices don't \ 
exist, but also simpler and faster because all those rules just need don't need \ 
to exist in parsing.

I cringe in thinking about how the code has lived for so long without noticing \ 
such a simple stupidity, and lapse of sufficient thought.

3.6.3:
Martin and Susanne

Of late, every release fixes major gaps and embarrassments of the last release....

And in some cases, like this one, exposes lacuna and rot.

I now have [control] flow under control, even if it isn't the most optimal way.

I now have greatly expanded automated testing.

On the most recent Python versions I regularly decompile thousands of Python \ 
programs that are distributed with Python. when it is possible, I then decompile \ 
Python's standard test suite distributed with Python and run the decompiled \ 
source code which basically checks itself. This amounts to about 250 test \ 
programs per version. This is in addition to the 3 CI testing services which do \ 
different things.

Does this mean the decompiler works perfectly? No. There are still a dozen or so \ 
failing programs, although the actual number of bugs is probably smaller though.

However, in perparation of a more major refactoring of the parser grammar, this \ 
release was born.

In many cases, decompilation is better. But there are some cases where \ 
decompilation has gotten worse. For lack of time (and interest) 3.0 bytecode \ 
suffered a hit. Possibly some code in the 3.x range did too. In time and with \ 
cleaner refactored code, this will come back.

Commit c90ff51 was a local maxiumum before, I started reworking the grammar to \ 
separate productions that were specific to loops versus those that are not in \ 
loops.
In the middle of that I added another grammar simplication to remove singleton \ 
productions of the form sstmts-> stmts. These were always was a bit ugly, and \ 
complicated output.

At any rate if decompilation fails, you can try c90ff51. Or another decompiler. \ 
unpyc37 is pretty good for 3.7. wibiti uncompyle2 is great for 2.7. pycdc is \ 
mediocre for Python before 3.5 or so, and not that good for the most recent \ 
Python. Generally these programs will give some sort of answer even if it isn't \ 
correct.

decompyle3 isn't that good for 3.7 and worse for 3.8, but right now it does \ 
things no other Python decompiler like unpyc37 or pycdc does. For example, \ 
decompyle3 handles variable annotations. As always, the issue trackers for the \ 
various programs will give you a sense for what needs to be done. For now, I've \ 
given up on reporting issues in the other decompilers because there are already \ 
enough issues reported, and they are just not getting fixed anyway.