Python Error: Cannot write a single file with animation format selected I'm trying to render a single image using a script i have written using blender 2.78c

If i run the script on the default cube it works fine.

If i run it on an existing .blend scene i have loaded i get this error.

I have tried:

bpy.ops.render.render( animation=False, write_still=True )

I've also removed all animations from the scene.

Is there a way to do this?
Oops, I had Properties / Render / Output / File format set to h.264 instead of png