Subject: [xml2rfc] #373 (Version 2 cli): xml2rfc UnboundLocalError?

From: "xml2rfc issue tracker" <[email-masked]>
Date: Tue, 18 Sep 2018 15:33:53 -0000

#373: xml2rfc UnboundLocalError?

 I'm getting this error (see the last line) when I just ran an XML source
 file through the online xml2rfc utility:

     Using
 XML_LIBRARY=/home/www/tools.ietf.org/tools/xml2rfc/web/public/rfc/bibxml:/home/www/tools.ietf.org/tools/xml2rfc/web/public/rfc/bibxml2:/home/www/tools.ietf.org/tools/xml2rfc/web/public/rfc/bibxml3:/home/www/tools.ietf.org/tools/xml2rfc/web/public/rfc/bibxml4:/home/www/tools.ietf.org/tools/xml2rfc/web/public/rfc/bibxml5:/home/www/tools.ietf.org/tools/xml2rfc/web/public/rfc/bibxml6:/home/www/tools.ietf.org/tools/xml2rfc/web/public/rfc/bibxml7:/home/www/tools.ietf.org/tools/xml2rfc/web/public/rfc/bibxml8

     Parsing file INPUT
     Resolving entity... ...
     Resolving entity... ...
     Resolving entity... ...
     Loaded from cache reference.RFC.2119.xml
     Resolving entity... ...
     Loaded from cache reference.RFC.5234.xml
     Resolving entity... ...
     Loaded from cache reference.RFC.6350.xml
     Resolving entity... ...
     Loaded from cache reference.RFC.8174.xml
     Traceback (most recent call last):
       File "/usr/local/bin/xml2rfc", line 9, in <module>
         load_entry_point('xml2rfc==2.10.1', 'console_scripts',
 'xml2rfc')()
       File "/usr/local/lib/python2.7/dist-packages/xml2rfc/run.py", line
 342, in main
         pagedwriter.write(filename)
       File "/usr/local/lib/python2.7/dist-
 packages/xml2rfc/writers/base.py", line 1351, in write
         self._build_document()
       File "/usr/local/lib/python2.7/dist-
 packages/xml2rfc/writers/base.py", line 1290, in _build_document
         self.write_reference_list(reference_list)
       File "/usr/local/lib/python2.7/dist-
 packages/xml2rfc/writers/raw_txt.py", line 789, in write_reference_list
         self.ref_start += i + 1
     UnboundLocalError: local variable 'i' referenced before assignment

     I don't know if there are errors in my XML source file. The
 UnboundLocalError causes xml2rfc to not produce any other output.

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

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

---

From: "xml2rfc issue tracker" <[email-masked]>
Date: Tue, 18 Sep 2018 21:18:50 -0000

Changes (by [email-masked]):

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

Comment:

 Fixed in [2582]:

 Fixed an issue where an empty <references/> section could cause an
 exception.

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

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