Opened 16 months ago

Last modified 16 months ago

#619 accepted defect

xml2rfc 3.6.0 fails with AttributeError: 'NoneType' object has no attribute 'tag'

Reported by: mahoney@nostrum.com Owned by:
Priority: medium Milestone:
Component: v3 vocabulary Version:
Keywords: Cc: rfc-editor@rfc-editor.org

Description

xml2rfc can generate a text file from the following:

https://www.rfc-editor.org/v3test/draft-ietf-hip-rfc4423-bis-20.xml

But when it attempts to create the html, it generates the following error:

Traceback (most recent call last):
  File "/usr/bin/xml2rfc", line 11, in <module>
    load_entry_point('xml2rfc==3.6.0', 'console_scripts', 'xml2rfc')()
  File "/usr/local/lib/python3.6/site-packages/xml2rfc/run.py", line 754, in main
    writer.write(filename)
  File "/usr/local/lib/python3.6/site-packages/xml2rfc/writers/html.py", line 266, in write
    html_tree = self.html_tree()
  File "/usr/local/lib/python3.6/site-packages/xml2rfc/writers/html.py", line 244, in html_tree
    html_tree = self.render(None, self.root)
  File "/usr/local/lib/python3.6/site-packages/xml2rfc/writers/html.py", line 321, in render
    res = func(h, x)
  File "/usr/local/lib/python3.6/site-packages/xml2rfc/writers/html.py", line 664, in render_rfc
    self.render(body, c)
  File "/usr/local/lib/python3.6/site-packages/xml2rfc/writers/html.py", line 321, in render
    res = func(h, x)
  File "/usr/local/lib/python3.6/site-packages/xml2rfc/writers/html.py", line 335, in skip_renderer
    self.render(h, c)
  File "/usr/local/lib/python3.6/site-packages/xml2rfc/writers/html.py", line 321, in render
    res = func(h, x)
  File "/usr/local/lib/python3.6/site-packages/xml2rfc/writers/html.py", line 2235, in render_references
    self.render(hh, c)
  File "/usr/local/lib/python3.6/site-packages/xml2rfc/writers/html.py", line 321, in render
    res = func(h, x)
  File "/usr/local/lib/python3.6/site-packages/xml2rfc/writers/html.py", line 2235, in render_references
    self.render(hh, c)
  File "/usr/local/lib/python3.6/site-packages/xml2rfc/writers/html.py", line 321, in render
    res = func(h, x)
  File "/usr/local/lib/python3.6/site-packages/xml2rfc/writers/html.py", line 2136, in render_reference
    self.render(inner, c)
  File "/usr/local/lib/python3.6/site-packages/xml2rfc/writers/html.py", line 321, in render
    res = func(h, x)
  File "/usr/local/lib/python3.6/site-packages/xml2rfc/writers/html.py", line 1162, in render_author
    if after_next.tag != 'author':
AttributeError: 'NoneType' object has no attribute 'tag'

Attachments (1)

draft-ietf-hip-rfc4423-bis-20.xml (164.8 KB) - added by rjsparks@nostrum.com 16 months ago.
Source that triggers the issue

Download all attachments as: .zip

Change History (4)

comment:1 Changed 16 months ago by mahoney@nostrum.com

I'm getting this file to work now, but I'm not sure what I did to fix it. Might still be worth looking at to see if a friendlier error message could be displayed.

File that works:

https://www.rfc-editor.org/v3test/draft-ietf-hip-rfc4423-bis-20-fixed.xml

Changed 16 months ago by rjsparks@nostrum.com

Source that triggers the issue

comment:2 Changed 16 months ago by rjsparks@nostrum.com

  • Status changed from new to accepted

comment:3 Changed 16 months ago by rjsparks@nostrum.com

This is where it goes off the rails:

<reference anchor="lindqvist-enterprise">
          <front>
            <title>Enterprise Network Packet Filtering for Mobile Cryptographic Identities</title>
            <author initials="J." surname="Lindqvist">
              <organization/>
            </author>
            <author initials="E." surname="Vehmersalo">
              <organization/>
            </author>
            <author initials="J." surname="Manner">
              <organization/>
            </author>
            <author initials="M." surname="Komu">
              <organization/>
            </author>

<!-- [rfced] commented out the following date line because xml2rfc returned Error: Expected a month name, found 'January-March' -->

<!--            <date year="2010" month="January-March"/> -->

          </front>
          <refcontent>International Journal of Handheld Computing Research, 1 (1), 79-94</refcontent>
        </reference>

Adding a date tag that parses correctly avoids the failure.

Note: See TracTickets for help on using tickets.