#2984: i.colors.enhance crash when input map(s) not existing
-----------------------------------------------+---------------------------
Reporter: neteler | Owner: grass-dev@…
Type: defect | Status: new
Priority: normal | Milestone: 7.0.4
Component: Python | Version: svn-
| releasebranch70
Keywords: i.colors.enhance, multiprocessing | CPU: All
Platform: All |
-----------------------------------------------+---------------------------
An error catch is needed:
{{{
GRASS 7.0.4svn (utm21S-sentinel-2-buenos-aires):~ > i.colors.enhance
b=S2A_USER_MSI_L2A_TL_SGS__20151211T193047_A002452_B03_10m_mosaik
g=S2A_USER_MSI_L2A_TL_SGS__20151211T193047_A002452_B04_10m_mosaik
r=S2A_USER_MSI_L2A_TL_SGS__20151211T193047_A002452_B8A_10m_mosaik
Processing...
FEHLER: Rasterkarte
<S2A_USER_MSI_L2A_TL_SGS__20151211T193047_A002452_B8A_10m_mosaik>
wurde nicht gefunden.
Process Process-1:
Traceback (most recent call last):
File "/usr/lib64/python2.7/multiprocessing/process.py", line 258, in
_bootstrap
self.run()
File "/usr/lib64/python2.7/multiprocessing/process.py", line 114, in run
self._target(*self._args, **self._kwargs)
File "/home/mundialis/software/grass70_svn/dist.x86_64-pc-linux-
gnu/scripts/i.colors.enhance", line 103, in get_percentile_mp
result = get_percentile(map, percentiles)
File "/home/mundialis/software/grass70_svn/dist.x86_64-pc-linux-
gnu/scripts/i.colors.enhance", line 89, in get_percentile
percentiles = values, quiet = True)
File "/home/mundialis/software/grass70_svn/dist.x86_64-pc-linux-
gnu/etc/python/grass/script/core.py", line 446, in read_command
return handle_errors(returncode, stdout, args, kwargs)
File "/home/mundialis/software/grass70_svn/dist.x86_64-pc-linux-
gnu/etc/python/grass/script/core.py", line 313, in handle_errors
returncode=returncode)
CalledModuleError: Module run None ['r.quantile', '--q',
'input=S2A_USER_MSI_L2A_TL_SGS__20151211T193047_A002452_B8A_10m_mosaik',
'percentiles=2,98'] ended with error
Process ended with non-zero return code 1. See errors in the (error)
output.
^CTraceback (most recent call last):
File "/home/mundialis/software/grass70_svn/dist.x86_64-pc-linux-
gnu/scripts/i.colors.enhance", line 226, in <module>
Process Process-2:
Process Process-3:
main()
Traceback (most recent call last):
Traceback (most recent call last):
File "/home/mundialis/software/grass70_svn/dist.x86_64-pc-linux-
gnu/scripts/i.colors.enhance", line 165, in main
File "/usr/lib64/python2.7/multiprocessing/process.py", line 258, in
_bootstrap
File "/usr/lib64/python2.7/multiprocessing/process.py", line 258, in
_bootstrap
(v0, v1) = input_pipe.recv()
KeyboardInterrupt
self.run()
self.run()
File "/usr/lib64/python2.7/multiprocessing/process.py", line 114, in run
File "/usr/lib64/python2.7/multiprocessing/process.py", line 114, in run
self._target(*self._args, **self._kwargs)
self._target(*self._args, **self._kwargs)
File "/home/mundialis/software/grass70_svn/dist.x86_64-pc-linux-
gnu/scripts/i.colors.enhance", line 103, in get_percentile_mp
File "/home/mundialis/software/grass70_svn/dist.x86_64-pc-linux-
gnu/scripts/i.colors.enhance", line 103, in get_percentile_mp
result = get_percentile(map, percentiles)
result = get_percentile(map, percentiles)
File "/home/mundialis/software/grass70_svn/dist.x86_64-pc-linux-
gnu/scripts/i.colors.enhance", line 89, in get_percentile
File "/home/mundialis/software/grass70_svn/dist.x86_64-pc-linux-
gnu/scripts/i.colors.enhance", line 89, in get_percentile
percentiles = values, quiet = True)
percentiles = values, quiet = True)
File "/home/mundialis/software/grass70_svn/dist.x86_64-pc-linux-
gnu/etc/python/grass/script/core.py", line 444, in read_command
File "/home/mundialis/software/grass70_svn/dist.x86_64-pc-linux-
gnu/etc/python/grass/script/core.py", line 444, in read_command
stdout, unused = process.communicate()
stdout, unused = process.communicate()
File "/usr/lib64/python2.7/subprocess.py", line 791, in communicate
File "/usr/lib64/python2.7/subprocess.py", line 791, in communicate
stdout = _eintr_retry_call(self.stdout.read)
stdout = _eintr_retry_call(self.stdout.read)
File "/usr/lib64/python2.7/subprocess.py", line 476, in
_eintr_retry_call
return func(*args)
File "/usr/lib64/python2.7/subprocess.py", line 476, in
_eintr_retry_call
KeyboardInterrupt
return func(*args)
KeyboardInterrupt
}}}
To replicate:
{{{
i.colors.enhance b=bla g=blu r=blo
...
}}}
Perhaps an is-input-existing-or-not test should (also) be added to the
respective lib/python/ library?
--
Ticket URL: <https://trac.osgeo.org/grass/ticket/2984>
GRASS GIS <https://grass.osgeo.org>