[GRASS-dev] [GRASS GIS] #3170: GRASS_BATCH_JOB does not tolerate path with spaces

GRASS GIS trac at osgeo.org
Thu Sep 29 01:28:33 PDT 2016


#3170: GRASS_BATCH_JOB does not tolerate path with spaces
----------------------------+-------------------------
 Reporter:  marisn          |      Owner:  grass-dev@…
     Type:  defect          |     Status:  new
 Priority:  normal          |  Milestone:  7.2.1
Component:  Startup         |    Version:  svn-trunk
 Keywords:  grass.py, init  |        CPU:  Unspecified
 Platform:  Unspecified     |
----------------------------+-------------------------
 It is not possible to execute any GRASS_BATCH_JOB script form a path
 containing spaces.
 {{{
 Executing </home/maris/my way/gol_batch.sh>....
 /bin/sh: /home/maris/my: No such file or directory
 }}}

 Quoting or shell escaping also doesn't work due to
 get_batch_job_from_env_variable checking file presence with os.access()

 Workaround is to change line 1351 of grass.py to read:
 {{{
 proc = Popen('"' + batch_job + '"', shell=True)
 }}}

 As quoting of path is a delicate issue and there have been fights in other
 parts of GRASS with Popen, I'll better leave for more experienced GRASS
 Pythonists to decide if such workaround can be considered safe or more
 serious changes are needed.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3170>
GRASS GIS <https://grass.osgeo.org>



More information about the grass-dev mailing list