[GRASS-dev] [GRASS GIS] #3089: exec_command fails if '.exe' not included in filename.
GRASS GIS
trac at osgeo.org
Mon Jul 4 02:02:38 PDT 2016
#3089: exec_command fails if '.exe' not included in filename.
-------------------------+---------------------------------
Reporter: artegion | Owner: grass-dev@…
Type: defect | Status: new
Priority: normal | Milestone: 7.0.5
Component: Default | Version: svn-releasebranch72
Keywords: | CPU: Unspecified
Platform: MSWindows 7 |
-------------------------+---------------------------------
Example (from v.centroids.py):
{{{
gscript.exec_command("v.category", type='area', **options)
}}}
fails with
{{{
Traceback (most recent call last):
File "C:\grass72\GRASS GIS 7.2.svn/scripts/v.centroids.py", line 68, in
<module>
main()
File "C:\grass72\GRASS GIS 7.2.svn/scripts/v.centroids.py", line 62, in
main
gscript.exec_command("v.category", type='area', **options)
File "C:\grass72\GRASS GIS 7.2.svn\etc\python\grass\script\core.py",
line 553,
in exec_command
os.execvpe(prog, args, env)
File "C:\grass72\GRASS GIS 7.2.svn\Python27\lib\os.py", line 353, in
execvpe
_execvpe(file, args, env)
File "C:\grass72\GRASS GIS 7.2.svn\Python27\lib\os.py", line 380, in
_execvpe
func(fullname, *argrest)
OSError: [Errno 2] No such file or directory
}}}
while modified source
{{{
gscript.exec_command("v.category.exe", type='area', **options)
}}}
works correctly.
It seems like os.execvpe does not use PATHEXT environment variable (maybe
because dot in filename overrides PATHEXT and ".category" is taken as file
extension)
--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3089>
GRASS GIS <https://grass.osgeo.org>
More information about the grass-dev
mailing list