Subject: [xml2rfc] #277 (Version 2 cli): An empty column breaks xml2rfc (throws unhandled exception)

From: "xml2rfc issue tracker" <[email-masked]>
Date: Sun, 16 Nov 2014 04:32:35 -0000

#277: An empty column breaks xml2rfc (throws unhandled exception)

 An empty column breaks xml2rfc:

 {{{
 Parsing file min.xml
 Traceback (most recent call last):
   File "/Users/cabo/bin/xml2rfc", line 225, in <module>
     main()
   File "/Users/cabo/bin/xml2rfc", line 210, in main
     pagedwriter.write(filename)
   File "/Users/cabo/lib/python2.7/site-packages/xml2rfc/writers/base.py",
 line 1180, in write
     self._build_index()
   File "/Users/cabo/lib/python2.7/site-packages/xml2rfc/writers/base.py",
 line 992, in _build_index
     self.write_section_rec(middle, None)
   File "/Users/cabo/lib/python2.7/site-packages/xml2rfc/writers/base.py",
 line 864, in write_section_rec
     level=level + 1, appendix=appendix)
   File "/Users/cabo/lib/python2.7/site-packages/xml2rfc/writers/base.py",
 line 842, in write_section_rec
     self.write_table(element)
   File "/Users/cabo/lib/python2.7/site-
 packages/xml2rfc/writers/paginated_txt.py", line 106, in write_table
     self.write_with_break_hint(BaseRfcWriter.write_table, 'raw', *args,
 **kwargs)
   File "/Users/cabo/lib/python2.7/site-
 packages/xml2rfc/writers/paginated_txt.py", line 81, in
 write_with_break_hint
     writer(self, *args, **kwargs)
   File "/Users/cabo/lib/python2.7/site-packages/xml2rfc/writers/base.py",
 line 772, in write_table
     self.draw_table(table, table_num=self.table_count)
   File "/Users/cabo/lib/python2.7/site-
 packages/xml2rfc/writers/raw_txt.py", line 1148, in draw_table
     for i in range(0, len(matrix))
   File
 "/Users/cabo/.homebrew/Cellar/python/2.7.8_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/textwrap.py",
 line 354, in wrap
     return w.wrap(text)
   File
 "/Users/cabo/.homebrew/Cellar/python/2.7.8_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/textwrap.py",
 line 329, in wrap
     return self._wrap_chunks(chunks)
   File
 "/Users/cabo/.homebrew/Cellar/python/2.7.8_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/textwrap.py",
 line 258, in _wrap_chunks
     raise ValueError("invalid width %r (must be > 0)" % self.width)
 ValueError: invalid width 0 (must be > 0)
 }}}

 {{{
 $ xml2rfc --version
 2.4.8
 }}}

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

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