Subject: [xml2rfc-dev] empty workgroup leads to crash

From: Miek Gieben <[email-masked]>
Date: Tue, 14 May 2019 07:54:32 +0100

Hi all,

If the workgroup is empty xml2rfc 2.22.3 crashes with the following stack trace:

    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

/Miek

--
Miek Gieben

---

From: Henrik Levkowetz <[email-masked]>
Date: Tue, 14 May 2019 12:36:58 +0200

Hi Miek,

Thanks for this.

Would it be possible for you to enter a ticket at
https://trac.tools.ietf.org/tools/xml2rfc/trac/newticket ?

Best regards,

	Henrik

On 2019-05-14 08:54, Miek Gieben wrote:
> _______________________________________________
> xml2rfc-dev mailing list
> [email-masked]
> https://www.ietf.org/mailman/listinfo/xml2rfc-dev
>