Compare commits

..

28 Commits

Author SHA1 Message Date
rocky
55b269f744 Get ready for release 2.6.2 2016-07-11 19:33:51 -04:00
rocky
8e0413273b Fix some Python set comprehension bugs 2016-07-11 18:23:05 -04:00
rocky
c10b9babbe Add missing a test source file 2016-07-11 10:22:06 -04:00
rocky
9fdf70f68d Python 3.(4?) while1 bug
Clean up while1 grammar a tad
2016-07-11 10:18:18 -04:00
rocky
f571f6dfce Revert recent 2.x code which fail verification 2016-07-10 20:06:05 -04:00
rocky
59ba8a65cd Structure detection bugs +
Had borked 3.4 grammar rules in
previous refactor
2016-07-10 19:21:55 -04:00
rocky
9c2f48ca4a DRY and clean up code a little 2016-07-10 08:39:50 -04:00
rocky
44dba42a40 Remove JA. Use standard JUMP_ABSOLUTE instead 2016-07-10 08:21:17 -04:00
rocky
af62286357 Python 2/3 compatibility bug 2016-07-10 08:15:22 -04:00
rocky
3cd3f7ccdf Bugs caused by 3.x jump_forward misclasification 2016-07-10 08:05:18 -04:00
rocky
52b71bb01a Python 3 better CONTINUE op classification
Also document what's up with JUMP_ABSOLUTE
classification
2016-07-10 06:47:34 -04:00
rocky
c098b834fa 3.4 continue handling. More work is needed 2016-07-09 23:20:08 -04:00
rocky
15bb9e3823 Need xdis 2.4 bugfix 2016-07-09 21:42:34 -04:00
rocky
21da5e787e Start splitting off 3.4 grammar from rest 2016-07-09 21:11:14 -04:00
rocky
b44c566a9f Python 2.3 list comprehensions 2016-07-09 18:13:08 -04:00
rocky
65b9ecee31 Fix some 2.3 bugs; add more 2.3-6. tests 2016-07-09 17:33:54 -04:00
rocky
047c95a1e5 2.3 while1stmt bug 2016-07-09 13:13:10 -04:00
rocky
5f9f8f4d79 Merge branch 'python-2.3' 2016-07-09 09:17:17 -04:00
rocky
ac45e5757c Redo Python 2.3 to be more like the rest 2016-07-09 09:11:04 -04:00
rocky
e40d5d3897 Merge conflict 2016-07-09 08:31:02 -04:00
rocky
ae78e9f930 Python3 scanner code cleanup 2016-07-09 05:17:10 -04:00
rocky
0075c8a5f7 Python 3 code cleanup 2016-07-08 22:33:42 -04:00
rocky
d6b35d57e4 DRY scanner code. Allow 2.4 decompile from 3.x 2016-07-08 21:37:09 -04:00
rocky
11eddb7940 Add more 2.4 and 2.6 tests 2016-07-08 18:24:14 -04:00
rocky
ec66dc0639 2.4 "import *" grammar rule 2016-07-08 18:12:35 -04:00
rocky
e31f829a56 Python 2.4 generator expressions and gen_comp_body 2016-07-08 18:00:13 -04:00
rocky
61535a010d <2.5 grammar customizations for imports and loops 2016-07-08 17:26:14 -04:00
rocky
62e60817f6 Start handling Pyton 2.4 bytecodes 2016-07-08 15:00:23 -04:00
295 changed files with 768 additions and 1566 deletions

186
ChangeLog
View File

@@ -1,6 +1,190 @@
2016-07-11 rocky <rb@dustyfeet.com>
* test/add-test.py,
test/simple_source/comprehension/05_set_comprehension.py,
uncompyle6/semantics/pysource.py: Fix some Python set comprehension
bugs
2016-07-11 rocky <rb@dustyfeet.com>
* test/simple_source/def/05_static_method.py: Add missing a test
source file
2016-07-11 rocky <rb@dustyfeet.com>
* uncompyle6/parser.py, uncompyle6/parsers/parse26.py,
uncompyle6/parsers/parse27.py, uncompyle6/parsers/parse3.py,
uncompyle6/scanners/scanner3.py: Python 3.(4?) while1 bug Clean up while1 grammar a tad
2016-07-10 rocky <rb@dustyfeet.com>
* uncompyle6/scanners/scanner2.py: Revert recent 2.x code which fail
verification
2016-07-10 rocky <rb@dustyfeet.com>
* uncompyle6/parsers/parse3.py, uncompyle6/parsers/parse34.py,
uncompyle6/scanners/scanner2.py, uncompyle6/scanners/scanner26.py,
uncompyle6/scanners/scanner3.py: Structure detection bugs + Had borked 3.4 grammar rules in previous refactor
2016-07-10 rocky <rb@dustyfeet.com>
* uncompyle6/scanner.py, uncompyle6/scanners/scanner2.py,
uncompyle6/scanners/scanner3.py: DRY and clean up code a little
2016-07-10 rocky <rb@dustyfeet.com>
* uncompyle6/scanners/scanner2.py,
uncompyle6/scanners/scanner26.py, uncompyle6/scanners/scanner27.py,
uncompyle6/scanners/scanner3.py: Remove JA. Use standard
JUMP_ABSOLUTE instead
2016-07-10 rocky <rb@dustyfeet.com>
* uncompyle6/scanners/scanner3.py: Python 2/3 compatibility bug
2016-07-10 rocky <rb@dustyfeet.com>
* uncompyle6/parsers/parse3.py, uncompyle6/scanners/scanner3.py:
Bugs caused by 3.x jump_forward misclasification
2016-07-10 rocky <rb@dustyfeet.com>
* uncompyle6/parsers/parse3.py, uncompyle6/scanners/scanner2.py,
uncompyle6/scanners/scanner26.py, uncompyle6/scanners/scanner3.py:
Python 3 better CONTINUE op classification Also document what's up with JUMP_ABSOLUTE classification
2016-07-09 rocky <rb@dustyfeet.com>
* uncompyle6/parsers/parse34.py: 3.4 continue handling. More work is
needed
2016-07-09 rocky <rb@dustyfeet.com>
* __pkginfo__.py: Need xdis 2.4 bugfix
2016-07-09 rocky <rb@dustyfeet.com>
* uncompyle6/parser.py, uncompyle6/parsers/parse3.py,
uncompyle6/parsers/parse34.py: Start splitting off 3.4 grammar from
rest
2016-07-09 rocky <rb@dustyfeet.com>
* test/simple_source/comprehension/01_list_comprehension.py,
uncompyle6/parsers/parse23.py: Python 2.3 list comprehensions
2016-07-09 rocky <rb@dustyfeet.com>
* test/simple_source/comprehension/01_list_comprehension.py,
test/simple_source/operation_binary/add.py,
test/simple_source/operation_binary/and.py,
test/simple_source/operation_binary/divide_floor.py,
test/simple_source/operation_binary/divide_true.py,
test/simple_source/operation_binary/modulo.py,
test/simple_source/operation_binary/multiply.py,
test/simple_source/operation_binary/or.py,
test/simple_source/operation_binary/power.py,
test/simple_source/operation_binary/shift_left.py,
test/simple_source/operation_binary/shift_right.py,
test/simple_source/operation_binary/subscription.py,
test/simple_source/operation_binary/subtract.py,
test/simple_source/operation_binary/xor.py,
test/simple_source/operation_comparison/equal.py,
test/simple_source/operation_comparison/greater.py,
test/simple_source/operation_comparison/greater_equal.py,
test/simple_source/operation_comparison/less.py,
test/simple_source/operation_comparison/less_equal.py,
test/simple_source/operation_comparison/notequal.py,
test/simple_source/operation_inplace/add.py,
test/simple_source/operation_inplace/and.py,
test/simple_source/operation_inplace/divide_floor.py,
test/simple_source/operation_inplace/divide_true.py,
test/simple_source/operation_inplace/modulo.py,
test/simple_source/operation_inplace/multiply.py,
test/simple_source/operation_inplace/or.py,
test/simple_source/operation_inplace/power.py,
test/simple_source/operation_inplace/shift_left.py,
test/simple_source/operation_inplace/shift_right.py,
test/simple_source/operation_inplace/subtract.py,
test/simple_source/operation_inplace/xor.py,
test/simple_source/operation_unary/invert.py,
test/simple_source/operation_unary/iter.py,
test/simple_source/operation_unary/negative.py,
test/simple_source/operation_unary/not.py,
test/simple_source/operation_unary/positive.py,
test/simple_source/precedence/left.py,
test/simple_source/precedence/right.py,
test/simple_source/precedence/structure.py,
test/simple_source/stmts/00_import.py,
uncompyle6/parsers/parse2.py, uncompyle6/parsers/parse23.py,
uncompyle6/parsers/parse25.py, uncompyle6/scanners/scanner26.py: Fix
some 2.3 bugs; add more 2.3-6. tests
2016-07-09 rocky <rb@dustyfeet.com>
* uncompyle6/parsers/parse23.py: 2.3 while1stmt bug
2016-07-09 rocky <rb@dustyfeet.com>
* : commit ac45e5757c8c57af2c918c79ff4f6195268afec1 Author: rocky
<rocky@gnu.org> Date: Sat Jul 9 05:59:02 2016 -0400
2016-07-09 rocky <rb@dustyfeet.com>
* uncompyle6/parsers/parse23.py: Merge conflict
2016-07-09 rocky <rocky@gnu.org>
* uncompyle6/scanners/scanner3.py: Python3 scanner code cleanup
2016-07-08 rocky <rocky@gnu.org>
* README.rst, uncompyle6/version.py: Get ready for release 2.6.1
* uncompyle6/scanners/scanner3.py,
uncompyle6/scanners/scanner32.py, uncompyle6/scanners/scanner33.py,
uncompyle6/scanners/scanner34.py, uncompyle6/scanners/scanner35.py:
Python 3 code cleanup
2016-07-08 rocky <rb@dustyfeet.com>
* test/Makefile, uncompyle6/scanner.py,
uncompyle6/scanners/scanner24.py, uncompyle6/scanners/scanner25.py,
uncompyle6/scanners/scanner26.py: DRY scanner code. Allow 2.4
decompile from 3.x
2016-07-08 rocky <rocky@gnu.org>
* : Add more 2.4 and 2.6 tests
2016-07-08 rocky <rocky@gnu.org>
* uncompyle6/parsers/parse24.py: 2.4 "import *" grammar rule
2016-07-08 rocky <rocky@gnu.org>
* uncompyle6/parsers/parse24.py, uncompyle6/scanners/scanner2.py,
uncompyle6/scanners/scanner24.py, uncompyle6/scanners/scanner26.py:
Python 2.4 generator expressions and gen_comp_body
2016-07-08 rocky <rocky@gnu.org>
* __pkginfo__.py, uncompyle6/parsers/parse24.py,
uncompyle6/scanners/scanner2.py: <2.5 grammar customizations for
imports and loops
2016-07-08 rocky <rocky@gnu.org>
* __pkginfo__.py, test/Makefile, test/add-test.py,
test/test_pyenvlib.py, test/test_pythonlib.py,
uncompyle6/parser.py, uncompyle6/parsers/parse24.py,
uncompyle6/parsers/parse25.py, uncompyle6/scanner.py,
uncompyle6/scanners/scanner24.py, uncompyle6/scanners/scanner25.py,
uncompyle6/semantics/pysource.py: Start handling Pyton 2.4 bytecodes
2016-07-08 rocky <rocky@gnu.org>
* ChangeLog, NEWS, README.rst, uncompyle6/version.py: Get ready for
release 2.6.1
2016-07-08 rocky <rocky@gnu.org>

9
NEWS
View File

@@ -1,3 +1,12 @@
uncompyle6 2.6.2 2016-07-11 Manhattenhenge
- Extend bytecodes back to 2.3
- Fix bugs:
* 3.x and 2.7 set comprehensions,
* while1 loops
* continue statements
- DRY and segregate grammar more
uncompyle6 2.6.1 2016-07-08
- Go over Python 2.5 bytecode deparsing

View File

@@ -11,9 +11,9 @@ Introduction
------------
*uncompyle6* translates Python bytecode back into equivalent Python
source code. It accepts bytecodes from Python version 2.5 to 3.5 or
source code. It accepts bytecodes from Python version 2.3 to 3.5 or
so. The code requires Python 2.6 or later and has been tested on Python
running versions 2.6, 2.7, 3.2, 3.3, 3.4 and 3.5.
running versions 2.3-2.7, and 3.2-3.5.
Why this?
---------
@@ -84,25 +84,21 @@ for usage help.
Known Bugs/Restrictions
-----------------------
Python 2 deparsing decompiles each and all the Python 2.7.10 and
2.7.11 installed packages I have on my system, more than 90% verify
ok. Some of these failures may be bugs in the verification process.
At this point, 2.7 decompilation is better than uncompyle2. A number
of bugs have been fixed over what was in uncompyle2.
Python 2 deparsing decompiles each and all the Python 2.3 to 2.7.10
installed packages I have on my system. Later distributions average
about 200 files.
All of the Python 3.2-3.5 Python standard lib packages that I have
installed on my system deparse. Each Python version has about 200
bytecode files. I'm not sure how well these verify though.
More than 90% of the 2.7 files verify ok Some of these failures may be
bugs in the verification process. At this point, 2.7 decompilation is
better than uncompyle2. A number of bugs have been fixed over what was
in uncompyle2.
There are a few constructs that still need to be added to Python 3.5
That said, I'd like the decompilation process still feels a little bit
hacky in certain places and we still get parse errors too often.
There are a few constructs that still need to be added to Python 3.5.
Python 3.6 changes things drastically by using word codes rather than
byte codes. So that will be yet another challenge
Python 2.5 and 2.6 installed library routines also decompile; it is
probably the same as uncompyle2, although some 2.6 bugs from
uncompyle2 have been fixed. We handle 2.5 and 2.6 bytecode a little
bit differently than the way uncompyle2 does so it is harder to assess
quality.
byte codes. So that will be yet another challenge.
There is lots to do, so please dig in and help.

View File

@@ -37,7 +37,7 @@ entry_points={
]}
ftp_url = None
install_requires = ['spark-parser >= 1.4.0',
'xdis >= 1.1.4']
'xdis >= 1.1.7']
license = 'MIT'
mailing_list = 'python-debugger@googlegroups.com'
modname = 'uncompyle6'

View File

@@ -43,7 +43,7 @@ check-disasm:
#: Check deparsing bytecode 2.x only
check-bytecode-2:
$(PYTHON) test_pythonlib.py --bytecode-2.3 --bytecode-2.5 --bytecode-2.6 --bytecode-2.7
$(PYTHON) test_pythonlib.py --bytecode-2.3 --bytecode-2.4 --bytecode-2.5 --bytecode-2.6 --bytecode-2.7
#: Check deparsing bytecode 3.x only
check-bytecode-3:
@@ -51,12 +51,16 @@ check-bytecode-3:
#: Check deparsing bytecode that works running Python 2 and Python 3
check-bytecode: check-bytecode-3
$(PYTHON) test_pythonlib.py --bytecode-2.5 --bytecode-2.6 --bytecode-2.7
$(PYTHON) test_pythonlib.py --bytecode-2.3 --bytecode-2.4 --bytecode-2.5 --bytecode-2.6 --bytecode-2.7
#: Check deparsing Python 2.3
check-bytecode-2.3:
$(PYTHON) test_pythonlib.py --bytecode-2.3
#: Check deparsing Python 2.4
check-bytecode-2.4:
$(PYTHON) test_pythonlib.py --bytecode-2.4
#: Check deparsing Python 2.5
check-bytecode-2.5:
$(PYTHON) test_pythonlib.py --bytecode-2.5

View File

@@ -2,12 +2,12 @@
""" Trivial helper program to bytecompile and run an uncompile
"""
import os, sys, py_compile
assert len(sys.argv) == 2
path = sys.argv[1]
short = os.path.basename(path)
assert len(sys.argv) >= 2
version = sys.version[0:3]
cfile = "bytecode_%s/%s" % (version, short) + 'c'
print("byte-compiling %s to %s" % (path, cfile))
py_compile.compile(path, cfile)
if sys.version >= (2, 6, 0):
os.system("../bin/uncompyle6 -a -t %s" % cfile)
for path in sys.argv[1:]:
short = os.path.basename(path)
cfile = "bytecode_%s/%s" % (version, short) + 'c'
print("byte-compiling %s to %s" % (path, cfile))
py_compile.compile(path, cfile)
if isinstance(version, str) or version >= (2, 6, 0):
os.system("../bin/uncompyle6 -a -t %s" % cfile)

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
test/bytecode_2.3/05_if.pyc Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
test/bytecode_2.4/05_if.pyc Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Some files were not shown because too many files have changed in this diff Show More