[GRASS-dev] [GRASS GIS] #2370: g.html2man.py fails while processing keyword list

#2370: g.html2man.py fails while processing keyword list
-------------------------+--------------------------------------------------
Reporter: marisn | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 7.1.0
Component: Python | Version: svn-trunk
Keywords: | Platform: Unspecified
      Cpu: Unspecified |
-------------------------+--------------------------------------------------
GRASS trunk r61272

{{{
VERSION_NUMBER=7.1.svn /home/maris/soft/grass_trunk/dist.x86_64-unknown-
linux-gnu/tools/g.html2man.py /home/maris/soft/grass_trunk/dist.x86_64
-unknown-linux-gnu/docs/html/keywords.html
/home/maris/soft/grass_trunk/dist.x86_64-unknown-linux-
gnu/docs/man/man1/keywords.1
/home/maris/soft/grass_trunk/dist.x86_64-unknown-linux-
gnu/docs/html/keywords.html:16:0: Error (IndexError('pop from empty
list',)): <dt><b><h2>SYNOPSIS</h2></b></dt><dd> <a
href="test.raster3d.lib.html">test.raster3d.lib</a></dd>
}}}

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/2370&gt;
GRASS GIS <http://grass.osgeo.org>

#2370: g.html2man.py fails while processing keyword list
--------------------------------+-------------------------------------------
Reporter: marisn | Owner: grass-dev@…
     Type: defect | Status: new
Priority: minor | Milestone: 7.1.0
Component: Parser | Version: svn-trunk
Keywords: HTML, documenation | Platform: Unspecified
      Cpu: Unspecified |
--------------------------------+-------------------------------------------
Changes (by wenzeslaus):

  * keywords: => HTML, documenation
  * priority: normal => minor
  * component: Python => Parser

Comment:

This was fixed by r61274 done by Soeren. r61275 compiles now.

However, we may consider if this is in fact bug in GRASS parser or
`g.html2man.py`. Perhaps, parser should not allow no keywords (checked in
`G_parser()` or "`--help`" function and company) and/or `g.html2man.py`
should provide better error message or work with an empty keywords list.
The error message also suggests that output of `--html-description` is not
a valid HTML (if there are no keywords) and if this is the case, this
should be fixed in the first place.

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/2370#comment:1&gt;
GRASS GIS <http://grass.osgeo.org>

#2370: g.html2man.py fails while processing keyword list
--------------------------------+-------------------------------------------
Reporter: marisn | Owner: grass-dev@…
     Type: defect | Status: new
Priority: minor | Milestone: 7.1.0
Component: Parser | Version: svn-trunk
Keywords: HTML, documenation | Platform: Unspecified
      Cpu: Unspecified |
--------------------------------+-------------------------------------------

Comment(by glynn):

Replying to [comment:1 wenzeslaus]:

> However, we may consider if this is in fact bug in GRASS parser or
`g.html2man.py`.

Or possibly in man/build_keywords.py.

That script appears to be trying to parse HTML using Python's generic
string-processing functions, which is unlikely to be robust. Consider
using tools/g.html2man/html.py.

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/2370#comment:2&gt;
GRASS GIS <http://grass.osgeo.org>