Export to GitHub

byteplay - issue #3

Pickling the code list, throws off the SetLineno detection


Posted on Jul 27, 2011 by Helpful Rhino

What steps will reproduce the problem? cmd = """# some python""" cmd = byteplay.Code.from_code( compile( cmd, '<string>', 'exec' ) )

serlized = base64.b64encode( pickle.dumps( cmd.code, pickle.HIGHEST_PROTOCOL ) )

in another process

code = byteplay.Code( pickle.loads( base64.b64decode( serlized ) ), (), (), False, False, False, '<module>', '<string>', 1, '' )

when code.to_code() is called, I get the error message:

The opcode SetLineNo isn't recognized or has a special flow control

If I replace obj is not SetLineno with not isinstance(obj, SetLinenoType) in isopcode

and op is SetLineno with isinstance( op, SetLinenoType )

It seems to work as expected

Status: New

Labels:
Type-Defect Priority-Medium