Anything in the Gateway console webpage, or the wrapper.log file? Some how we need more data to find out what is happening.
Maybe the problem is related to more than one process trying to access the file. Does it work if you close the file in your editor and restart Ignition?
We fixed a couple of NPE issues involving 3rd party Python libraries in Ignition 7.7.5. You might try downloading that version and see if it solves your particular problem.