Skip to content

yori-grid fails with relative output file

Bruce Flynn requested to merge (removed):fix-relpath into master

I get a permission error when using a relative path for the output filename.

yori-grid \
    /mnt/deliveredcode/deliveries/viirstpw_preyori/20171019-1/dist/day_night_separation.yaml \
    TMP.VNPWATVP_D3.A2014108.0006.001.2017209093446.nc \
    VNPWATVP_D3.A2014108.0006.001.2017209093446.nc

results in the following traceback

Traceback (most recent call last):
  File "/home/brucef/.local/miniconda2/envs/flo/bin/yori-grid", line 11, in <module>
    load_entry_point('yori', 'console_scripts', 'yori-grid')()
  File "/home/brucef/code/yori/yori/tools/grid.py", line 22, in main
    debug=args.debug)
  File "/home/brucef/code/yori/yori/run_yori.py", line 171, in run_yori
    outInst.createFile()
  File "/home/brucef/code/yori/yori/ioutils.py", line 85, in createFile
    ncdf = nc.Dataset(self.path + self.name, mode='w', format='NETCDF4')
  File "netCDF4/_netCDF4.pyx", line 1859, in netCDF4._netCDF4.Dataset.__init__
  File "netCDF4/_netCDF4.pyx", line 1556, in netCDF4._netCDF4._ensure_nc_success
IOError: Permission denied

This merge request fixes this issue by using the python os.path utilities for path (de)construction.

Edited by Bruce Flynn

Merge request reports

Loading