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:

self.particleEffect.saveConfig('test.ptf')

Got this error:

  File "/usr/share/panda3d/direct/particles/ParticleEffect.py", 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/ParticleEffect.py 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 panda3d.org/manual/index.php … le_Systems ). And for newbies it’s not clear what to do, when they get the error.