When I try to use a relative path within GNU Radio (e.g. for a sink or source block), it errors out with "can't open file".
The assumption is that the path is relative to the location of the .grc file location.
When a python file is generated by GRC, running that file on the command line produces the desired result. It just doesn't work through the GNU Radio Companion interface.
GNU Radio Companion (GRC) paths are relative to where GRC is started.
If the script is intended to be run from its containing directory, a "Python Module" block can be added to GRC with the contents: