Subject: Re: [xml2rfc] #331 (Version 2 cli): exception from missing author for reference

From: "xml2rfc issue tracker" <[email-masked]>
Date: Mon, 29 May 2017 23:21:06 -0000

#331: exception from missing author for reference

Description changed by [email-masked]:

Old description:

> Traceback (most recent call last):
>   File "/usr/local/bin/xml2rfc", line 9, in <module>
>     load_entry_point('xml2rfc==2.5.2', 'console_scripts', 'xml2rfc')()
>   File "/Library/Python/2.7/site-packages/xml2rfc/run.py", line 213, in
> main
>     htmlwriter.write(filename)
>   File "/Library/Python/2.7/site-packages/xml2rfc/writers/base.py", line
> 1265, in write
>     self._build_document()
>   File "/Library/Python/2.7/site-packages/xml2rfc/writers/base.py", line
> 1211, in _build_document
>     self.write_reference_list(reference_list)
>   File "/Library/Python/2.7/site-packages/xml2rfc/writers/html.py", line
> 569, in write_reference_list
>     a.tail = ', '
> UnboundLocalError: local variable 'a' referenced before assignment
>
> That was caused when trying to make an html file from an xml file that
> was generated by kramdown where I had normative and informative
> references that didn't have an associated author.  The .xml file had
> empty "<author> </author>".  The conversion to .txt succeeded without
> complaint.
>
> Independent of whether author is required for every reference, this could
> be handled more gracefully.  I've also filed a ticket against kramdown to
> look at whether having an author in the reference needs to be enforced.

New description:

 {{{
 Traceback (most recent call last):
   File "/usr/local/bin/xml2rfc", line 9, in <module>
     load_entry_point('xml2rfc==2.5.2', 'console_scripts', 'xml2rfc')()
   File "/Library/Python/2.7/site-packages/xml2rfc/run.py", line 213, in
 main
     htmlwriter.write(filename)
   File "/Library/Python/2.7/site-packages/xml2rfc/writers/base.py", line
 1265, in write
     self._build_document()
   File "/Library/Python/2.7/site-packages/xml2rfc/writers/base.py", line
 1211, in _build_document
     self.write_reference_list(reference_list)
   File "/Library/Python/2.7/site-packages/xml2rfc/writers/html.py", line
 569, in write_reference_list
     a.tail = ', '
 UnboundLocalError: local variable 'a' referenced before assignment
 }}}

 That was caused when trying to make an html file from an xml file that was
 generated by kramdown where I had normative and informative references
 that didn't have an associated author.  The .xml file had empty "<author>
 </author>".  The conversion to .txt succeeded without complaint.

 Independent of whether author is required for every reference, this could
 be handled more gracefully.  I've also filed a ticket against kramdown to
 look at whether having an author in the reference needs to be enforced.

--

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

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

---

From: "xml2rfc issue tracker" <[email-masked]>
Date: Mon, 29 May 2017 23:32:04 -0000

Comment (by [email-masked]):

 I've merged in a number of changes over the last couple of days, and now
 cannot reproduce
 this issue from the description.  Would it be possible for you to attach a
 test file
 which triggers the exception with your copy of xml2rfc?

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