tags:

views:

80

answers:

2

The Psyco log output look like this:

21:08:47.56  Logging started, 10/29/09                  %%%%%%%%%%%%%%%%%%%%
21:08:47.56  unsupported opcode 54 at create_l0:124                      % %
21:08:47.56  unsupported opcode 54 at create_lx:228                      % %

the lines in question

class File:
    def __init__(self, path, header):
        self.path = path
        self.header = header
        self.file = path + '/' + header.to_filename()
        self.pfile = None

    def add_entry(self, entry):                        # line 124
        self.pfile.write(entry.to_binary())

    def open(self):
        self.pfile = open(self.file, 'wb')
        self.pfile.write(self.header.to_binary())

    def close(self):
        self.pfile.close()

    def write(self, data):
        self.pfile.write(data)

next one:

nat_file = File(target + '/' + name, nat_header)
nat_file.open()
# add first value
nat_file.add_entry(DataBlock(t, q, 0.0, 1, v))
# add all others
while True:
    try:
        t, v, q = f.next()
    except StopIteration:
        break
    nat_file.add_entry(DataBlock(t, q, 0.0, 1, v))
nat_file.close()                                     # line 228

I'm a bit at loss what the problem may be. Any ideas?

A: 

Did you compile with another Psyco version than you are running the script with?

Sjoerd
not that I'm aware of. I installed psyco with the ubuntu package manager.
Mauli
+2  A: 

Finding the name of the opcode using the number is actually pretty easy (below uses Python 2.6.2 on Ubuntu, you may get different results):

>>> import dis
>>> dis.opname[54]
'STORE_MAP'

Of course, finding out what exactly this means is another question entirely. :-)

Jason Baker
Ah, that's a much easier way of finding out what opcodes are... I went digging through `Python/Lib/opcode.py` to find `def_op('STORE_MAP', 54)`
ephemient
with that information I found http://thomas.apestaart.org/log/?p=927so the problem is obviously that STORE_MAP is new in Python 2.6 and probably not supported by Psyco. I guess I will try to run my program with python 2.5, than this shouldn't happen anymore.
Mauli