Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError decoding NodePath from BAM stream #199

Closed
Epihaius opened this issue Nov 25, 2017 · 1 comment
Closed

TypeError decoding NodePath from BAM stream #199

Epihaius opened this issue Nov 25, 2017 · 1 comment
Assignees

Comments

@Epihaius
Copy link
Contributor

When trying to unpickle a NodePath from a previously pickled string, I get the following TypeError:

TypeError: py_decode_NodePath_from_bam_stream() takes exactly one argument (2 given)

When using cPickle instead of the regular pickle module, the error report is basically the same, but more verbose:

TypeError: ('py_decode_NodePath_from_bam_stream() takes exactly one argument (2 given)', <built-in function py_decode_NodePath_from_bam_stream>, (<type 'panda3d.core.NodePath'>, 'pbj\x00\n\r\x06\x00\x00\x00\x06\x00*\x00\x01\x00\x05\x00\x00\x00\x00\x01\x00\x00\x00\x91\x00\x00\x00\x004\x00\t\x00PandaNode\x023\x00\x1b\x00TypedWritableReferenceCount\x022\x00\r\x00TypedWritable\x01\x03\x00\x0b\x00TypedObject\x00\x04\x00\x0e\x00ReferenceCount\x00\r\x00\x07\x00Namable\x00\x01\x00\x00\x00\x02\x00\x03\x00\x04\x00\x00\x00\x00\x00\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00Z\x00\x00\x00\x02\x9f\x00\x0b\x00RenderState\x01\x9e\x00\x18\x00NodeCachedReferenceCount\x017\x00!\x00CachedTypedWritableReferenceCount\x013\x00\x02\x00\x00\x00\x1c\x00\x00\x00\x02\xae\x00\x0e\x00TransformState\x01\x9e\x00\x03\x00\x05\x00\x01\x00\x19\x00\x00\x00\x02\x9c\x00\r\x00RenderEffects\x013\x00\x04\x00\x00\x00\x01\x00\x00\x00\x01'))

The following code sample demonstrates the problem:

from panda3d.core import *
from direct.showbase.ShowBase import ShowBase
import pickle


class MyApp(ShowBase):

    def __init__(self):

        ShowBase.__init__(self)

        np = NodePath("")
        s = pickle.dumps(np, -1)
        loaded_np = pickle.loads(s)


app = MyApp()
app.run()

This issue occurs using version 46c8852 of Panda3D with Python 2.7 64-bit.

@rdb rdb self-assigned this Nov 25, 2017
@rdb rdb added the regression label Nov 25, 2017
@rdb rdb closed this as completed in 749b23a Nov 25, 2017
@rdb
Copy link
Member

rdb commented Nov 25, 2017

Thanks, this was an oversight in a recent bugfix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants