Save a particle effect

Hello folks,

I’m writing on a small developer tool. For this tool, I create an particle effect from code. Now I tried to save it, like:


Got this error:

  File "/usr/share/panda3d/direct/particles/", line 161, in saveConfig
    f = open(filename.toOsSpecific(), 'wb')
AttributeError: 'str' object has no attribute 'toOsSpecific'

For the moment, I fixed /usr/share/panda3d/direct/particles/ like this:

    def saveConfig(self, filename):
        f = open(Filename.toOsSpecific(Filename(filename)), 'wb')
#was before:
    def saveConfig(self, filename):
        f = open(filename.toOsSpecific(), 'wb')
#looks weird, doesn't it?

So, my questions are: is my fix correct (what it seems), and should I make a bugreport? Or am I doing something wrong and my fix is not intended? For your information, I am using Panda 1.8.1 (compiled on my own for Ubuntu 13.04). Thanks alot!

Can’t you simply pass a Filename instance to saveConfig in the first place, like saveConfig(Filename(‘test.ptf’))?

Yes, that works, too. But it differs from the manual (refer to … le_Systems ). And for newbies it’s not clear what to do, when they get the error.