create a text window in blender (I hope you know how do that)
open your python file using the [-] button (not key) on the window header
run your script by having your cursor in that window and pressing alt+p
your errors will be put on the console (even if you can’t see it)
The open file command is only for blender files, or for vrml and dxf files (which are imported I believe into the current file). Blender was complaining that your script was not a valid blender file (I think)