Subject: [xml2rfc] #407 (Version 2 cli): empty workgroup leads to crash

From: "xml2rfc issue tracker" <[email-masked]>
Date: Tue, 14 May 2019 18:36:38 -0000

#407: empty workgroup leads to crash

 If the workgroup is empty xml2rfc 2.22.3 crashes with the following stack
 trace:
 (sorry for the horrendous make up)

 {{{
 >
 >     xml2rfc --text --v3 draft-gieben-mmark-00.xml && rm draft-gieben-
 mmark-00.xml
 >     Parsing file draft-gieben-mmark-00.xml
 >     Traceback (most recent call last):
 >       File "/usr/bin/xml2rfc", line 11, in <module>
 >         load_entry_point('xml2rfc==2.22.3', 'console_scripts',
 'xml2rfc')()
 >       File "/usr/lib/python2.7/dist-packages/xml2rfc/run.py", line 549,
 in main
 >         writer.write(filename)
 >       File "/usr/lib/python2.7/dist-packages/xml2rfc/writers/text.py",
 line 228, in write
 >         lines = self.render(self.root, width=72, joiners=joiners)
 >       File "/usr/lib/python2.7/dist-packages/xml2rfc/writers/text.py",
 line 271, in render
 >         res = func(e, width, **kwargs)
 >       File "/usr/lib/python2.7/dist-packages/xml2rfc/writers/text.py",
 line 2834, in render_rfc
 >         lines = self.ljoin(lines, c, width, **kwargs)
 >       File "/usr/lib/python2.7/dist-packages/xml2rfc/writers/text.py",
 line 446, in ljoin
 >         res = mklines(self.render(e, width, **kwargs), e)
 >       File "/usr/lib/python2.7/dist-packages/xml2rfc/writers/text.py",
 line 271, in render
 >         res = func(e, width, **kwargs)
 >       File "/usr/lib/python2.7/dist-packages/xml2rfc/writers/text.py",
 line 1604, in render_front
 >         text = '\n\n\n\n' + self.render_first_page_top(e, width,
 **kwargs) + '\n'
 >       File "/usr/lib/python2.7/dist-packages/xml2rfc/writers/text.py",
 line 1796, in render_first_page_top
 >         left  = get_left(e)
 >       File "/usr/lib/python2.7/dist-packages/xml2rfc/writers/text.py",
 line 1723, in get_left
 >         left.append(group.text.strip())
 >     AttributeError: 'NoneType' object has no attribute 'strip'
 >     Makefile:8: recipe for target 'draft-gieben-mmark-00.txt' failed
 >     make: *** [draft-gieben-mmark-00.txt] Error 1
 }}}

-- 
---------------------------+----------------------------------
 Reporter:  [email-masked]   |      Owner:  [email-masked]
     Type:  defect         |     Status:  new
 Priority:  medium         |  Milestone:
Component:  Version 2 cli  |    Version:  2.10.x
 Keywords:                 |
---------------------------+----------------------------------

Ticket URL: <https://trac.tools.ietf.org/tools/xml2rfc/trac/ticket/407>
xml2rfc <http://tools.ietf.org/tools/xml2rfc/>

---

From: "xml2rfc issue tracker" <[email-masked]>
Date: Tue, 14 May 2019 20:04:13 -0000

Changes (by [email-masked]):

 * status:  new => closed
 * resolution:   => fixed

Comment:

 Fixed in [3116]:

 Deal better with <workgroup> without content.

-- 
----------------------------+----------------------------------
  Reporter:  [email-masked]   |      Owner:  [email-masked]
      Type:  defect         |     Status:  closed
  Priority:  medium         |  Milestone:
 Component:  Version 2 cli  |    Version:  2.10.x
Resolution:  fixed          |   Keywords:
----------------------------+----------------------------------

Ticket URL: <https://trac.tools.ietf.org/tools/xml2rfc/trac/ticket/407#comment:1>
xml2rfc <http://tools.ietf.org/tools/xml2rfc/>

---

From: "xml2rfc issue tracker" <[email-masked]>
Date: Wed, 15 May 2019 05:43:07 -0000

Comment (by [email-masked]):

 FWIW, an empty workgroup element could be considered an input error; at
 least a warning (if not more) seems to be appropriate.

Ticket URL: <https://trac.tools.ietf.org/tools/xml2rfc/trac/ticket/407#comment:2>
xml2rfc <http://tools.ietf.org/tools/xml2rfc/>