[PEAK] trying to run peak-rules on python3

PJ Eby pje at telecommunity.com
Wed Mar 27 13:03:18 EDT 2013


On Wed, Mar 27, 2013 at 9:07 AM, Hervé Coatanhay
<herve.coatanhay at gmail.com> wrote:
> Ok so I had to remove Predicates.txt form the list of files in
> test_rules.py.

Looks like you've got a lot of work ahead of you.  Lots of stuff is
shallow failures due to reprs, tests not being in Python 3 syntax
(e.g. "print" statements), sorting issues in Python 3 (you can't
compare None to other types), lack of "long" type, set repr being {}
instead of ([]) as in Python 2, etc.

The good news is that a few small changes will fix a lot of errors in
that log.  The bad news is that you must make the changes first,
because these shallow problems are preventing the tests from showing
us what the *real* problems are.

I did however spot one thing that looks like a real problem: it
appears that BytecodeAssembler's use of .tostring() calls should
change to .tobytes(), because the __code__ attribute in Python 3 is a
bytestring.  I think this is causing most of the errors in
Code-Generation.txt.

A few other things I found:

* It appears the codegen module isn't fully importing; it should
export a Repr, but doesn't.  It'd be good to get the actual error
message, if any.
* It appears that certain SLICE_* opcodes have gone away in Python 3;
don't know what they're replaced with.
* Don't bother trying to fix the README and DESIGN errors, or the ones
in test_rules itself; they are all being caused by a lower-level
failure, probably in the peak.rules.criteria, .indexing, .codegen, or
.predicates modules, if not BytecodeAssembler itself.

Good luck.  ;-)

(Btw, It would probably be a good idea to send the next log to a paste
website rather than attaching it, given the size of these things.)


More information about the PEAK mailing list