I am actually trying to open a blend file from a script and I have to make a copy of the scene so that I can make some modifications in the new scene. However, after I run
bpy.ops.wm.open_mainfile(filepath = 'a saved .blend file path')
bpy.ops.scene.new.(type = 'LINK_COPY')
blender crashes and leaves an error of 'EXCEPTION_ACCESS_VIOLATION'. I believe that the context could not have been set and this problem is showing up but I have not been able to figure out how to get rid of this error. My script is actually long but these two line of code is sufficient to reproduce this problem for anybody.
What would I need to do before trying to make a copy of the scene?