How can I open an image with a Python script in Windows? In the script editor in Blender 2.79 on Windows, I can open an image with:

bpy.ops.image.open(filepath="C:\\path\\to\\image.png")

However, if I put this code in a .py file and open Blender from the command line (git bash, in this case), passing the .py file with a --python flag, Blender crashes:


  Error: EXCEPTION_ACCESS_VIOLATION


What's up here?
Looks like a bug, it works in Blender 2.78c – I've reported it here: https://developer.blender.org/T53446

Update: Fixed in 2.79a: https://developer.blender.org/rB5b3c15e3363aa7bea5d26c56191b7e8e74021868