setOneShot and RTMCopyRam?

Running your code from the first post on my older mac, it runs until I hit b, then if freezes for a while and crashes with a bus error:

DirectStart: Starting the game.
Known pipe types:
osxGraphicsPipe
(all display modules loaded.)
Made GLGraphicsBuffer
/var/folders/M4/M4oCK5IpHAucjm-kozc7uk+++TI/Cleanup At Startup/untitled text-339307867.848.command: line 3: 252 Bus error /usr/local/bin/python /private/var/folders/M4/M4oCK5IpHAucjm-kozc7uk+++TI/Cleanup\ At\ Startup/untitled\ text-339307867.730
logout

[Process completed]

Anyway, thats not the computer I usually use (horrible graphics support), and your code works fine on the machine which I was producing my issue on (a newer mac).

This modified version which reuses the same buffer only works the first time, then all repeated attempts never finish. This is the issue I was having I think.

from direct.directbase.DirectStart import * 
from panda3d.core import * 

def saveTexture(tex, buffer, task): 
    if not tex.hasRamImage(): 
        return task.cont 

    print "Got texture" 
    tex.write('tex.png') 
    cm = CardMaker('card') 
    cm.setFrame(-0.5, 0.5, -0.5, 0.5) 
    card = aspect2d.attachNewNode(cm.generate()) 
    card.setTexture(tex) 
    
    buffer.clearRenderTextures()

    return task.done 

buffer = base.win.makeTextureBuffer('buffer', 256, 256, Texture(), True) 

def makeBuffer(): 
    tex = Texture('tex') 
    
    
    mode=GraphicsOutput.RTMCopyRam
    buffer.addRenderTexture(tex,mode)
    
    buffer.setClearColor((0, 0, 0, 1)) 
    print "Made %s" % (buffer.getType()) 

    bufscene = NodePath('bufscene') 
    bufcam = bufscene.attachNewNode(Camera('bufcam')) 
    dr = buffer.makeDisplayRegion() 
    dr.setCamera(bufcam) 

    m = loader.loadModel('smiley.egg') 
    m.reparentTo(bufscene) 
    m.setPos(0, 20, 0) 

    buffer.setOneShot(True) 

    taskMgr.add(saveTexture, 'saveTexture', extraArgs = [tex, buffer], appendTask = True) 
    
    
base.accept('b', makeBuffer) 
run() 

That should work right?