#1613: r.hazard.flood.py returns a ParseError
-------------------------------+--------------------------------------------
Reporter: Ddm | Owner: grass-dev@…
Type: defect | Status: new
Priority: normal | Milestone: 6.4.3
Component: Raster | Version: unspecified
Keywords: r.hazard.flood.py | Platform: MSWindows 7
Cpu: Unspecified |
-------------------------------+--------------------------------------------
Hi,
I'm trying to run the r.hazard.flood.py add-on, but I'm getting the
following error message.
I'm new to GRASS so I apologise if this is an obvious user error.
Many thanks.
-----------------------------
(Mon Mar 12 22:47:16 2012)
r.hazzard.flood.py
C:\Program Files (x86)\GRASS 6.4.2\extrabin\python.exe:
can't open file 'r.hazzard.flood.py': [Errno 2] No such file
or directory
(Mon Mar 12 22:47:17 2012) La commande s'est terminée (0 sec)
Traceback (most recent call last):
File "C:\Program Files (x86)\GRASS
6.4.2\etc\wxpython\gui_modules\prompt.py", line 1105, in
OnKeyPressed
self.parent.RunCmd(cmd)
File "C:\Program Files (x86)\GRASS
6.4.2\etc\wxpython\gui_modules\goutput.py", line 523, in
RunCmd
task = menuform.GUI(show = None).ParseCommand(command)
File "C:\Program Files (x86)\GRASS
6.4.2\etc\wxpython\gui_modules\menuform.py", line 1732, in
ParseCommand
blackList = _blackList)
File "C:\Program Files (x86)\GRASS
6.4.2\etc\python\grass\script\task.py", line 460, in
parse_interface
tree = etree.fromstring(get_interface_description(name))
File "C:\Program Files (x86)\GRASS
6.4.2\Python27\lib\xml\etree\ElementTree.py", line 1283, in
XML
return parser.close()
File "C:\Program Files (x86)\GRASS
6.4.2\Python27\lib\xml\etree\ElementTree.py", line 1636, in
close
self._raiseerror(v)
File "C:\Program Files (x86)\GRASS
6.4.2\Python27\lib\xml\etree\ElementTree.py", line 1488, in
_raiseerror
raise err
xml.etree.ElementTree
.
ParseError
:
no element found: line 1, column 0
you are trying to run 'r.hazzard.flood.py', which is a typo. Correct is
r.hazard.flood.
Nevertheless, if i try to run r.hazzard.flood as you did, i don't get that
error message.
By the way, the module is an add-on written on linux platform, and AFAIK
not yet tested on windows. If you are willing to test it, you are very
welcome.
Could you please try to run it again. And, please, download the r51053. I
just found that the version online was not up-to-date.
Thanks for your help.
Actually, it is not a typo: I do have to launch "r.hazard.flood.py".
Otherwise I get the error message below. It is also hte name that appears
in my list of modules. As a matter of fact, it is the only one that has
the ".py" extension in this list.
I also updated with the latest code but I still get the same error message
(the original one I mean).
---------------
(Tue Mar 13 23:39:10 2012)
r.hazard.flood
C:\Program Files (x86)\GRASS 6.4.2\Python27\lib\site.py:158:
Warning: 'with' will become a reserved keyword in Python 2.6
'import site' failed; use -v for traceback
C:\Program Files (x86)\GRASS
6.4.2\Python27\lib\linecache.py:127: Warning: 'with' will
become a reserved keyword in Python 2.6
Traceback (most recent call last):
File "C:\Users\David\AppData\Roaming\GRASS6\addons\r.hazar
d.flood.py", line 47, in <module>
import grass.script as grass
File "C:\Program Files (x86)\GRASS
6.4.2\etc\python\grass\__init__.py", line 1, in <module>
import os
File "C:\Program Files (x86)\GRASS
6.4.2\Python27\lib\os.py", line 754
bs = b""
^
SyntaxError: invalid syntax
(Tue Mar 13 23:39:10 2012) La commande s'est terminée (0 sec)
Replying to [comment:2 Ddm]:
> hi,
>
> Thanks for your help.
> Actually, it is not a typo: I do have to launch "r.hazard.flood.py".
Otherwise I get the error message below. It is also hte name that appears
in my list of modules. As a matter of fact, it is the only one that has
the ".py" extension in this list.
>
> I also updated with the latest code but I still get the same error
message (the original one I mean).
>
>
> ---------------
> (Tue Mar 13 23:39:10 2012)
> r.hazard.flood
> C:\Program Files (x86)\GRASS 6.4.2\Python27\lib\site.py:158:
> Warning: 'with' will become a reserved keyword in Python 2.6
> 'import site' failed; use -v for traceback
> C:\Program Files (x86)\GRASS
> 6.4.2\Python27\lib\linecache.py:127: Warning: 'with' will
> become a reserved keyword in Python 2.6
> Traceback (most recent call last):
> File "C:\Users\David\AppData\Roaming\GRASS6\addons\r.hazar
> d.flood.py", line 47, in <module>
> import grass.script as grass
> File "C:\Program Files (x86)\GRASS
> 6.4.2\etc\python\grass\__init__.py", line 1, in <module>
> import os
> File "C:\Program Files (x86)\GRASS
> 6.4.2\Python27\lib\os.py", line 754
> bs = b""
> ^
> SyntaxError: invalid syntax
> (Tue Mar 13 23:39:10 2012) La commande s'est terminée (0 sec)
hi,
thanks for feedback. Actually the typo I meant is "hazzard" instead of
"hazard".
I am not able to reproduce the error because i don't have access to
windows machine. Any idea from developers is very appreciated to try to
solve this issue. Thanks for patience.