Subject: [xml2rfc] #282 (Version 2 cli): <?rfc needLines="#" ?> causes stack trace.

From: "xml2rfc issue tracker" <[email-masked]>
Date: Thu, 05 Feb 2015 18:54:01 -0000

#282: <?rfc needLines="#" ?> causes stack trace.

 Having the line <?rfc needLines="#" ?> crashes the basic paginated text
 writer:

 Traceback (most recent call last):
   File "/usr/local/bin/xml2rfc", line 4, in <module>
     __import__('pkg_resources').run_script('xml2rfc==2.4.9dev0',
 'xml2rfc')
   File "/usr/local/lib/python2.7/dist-packages/pkg_resources.py", line
 517, in run_script
     self.require(requires)[0].run_script(script_name, ns)
   File "/usr/local/lib/python2.7/dist-packages/pkg_resources.py", line
 1436, in run_script
     exec(code, namespace, namespace)
   File "/usr/local/lib/python2.7/dist-packages/xml2rfc-2.4.9dev0-py2.7.egg
 /EGG-INFO/scripts/xml2rfc", line 239, in <module>
     main()
   File "/usr/local/lib/python2.7/dist-packages/xml2rfc-2.4.9dev0-py2.7.egg
 /EGG-INFO/scripts/xml2rfc", line 224, in main
     pagedwriter.write(filename)
   File "/usr/local/lib/python2.7/dist-
 packages/xml2rfc-2.4.9dev0-py2.7.egg/xml2rfc/writers/base.py", line 1180,
 in write
     self._build_index()
   File "/usr/local/lib/python2.7/dist-
 packages/xml2rfc-2.4.9dev0-py2.7.egg/xml2rfc/writers/base.py", line 992,
 in _build_index
     self.write_section_rec(middle, None)
   File "/usr/local/lib/python2.7/dist-
 packages/xml2rfc-2.4.9dev0-py2.7.egg/xml2rfc/writers/base.py", line 864,
 in write_section_rec
     level=level + 1, appendix=appendix)
   File "/usr/local/lib/python2.7/dist-
 packages/xml2rfc-2.4.9dev0-py2.7.egg/xml2rfc/writers/base.py", line 830,
 in write_section_rec
     self.needLines(pis["needLines"])
   File "/usr/local/lib/python2.7/dist-
 packages/xml2rfc-2.4.9dev0-py2.7.egg/xml2rfc/writers/paginated_txt.py",
 line 92, in needLines
     if int(count) < 0:
 ValueError: invalid literal for int() with base 10: '#'

 I think Changeset 1122 was supposed to have fixed this but it isn't
 protected against silly count values.

-- 
-----------------------------------+--------------------------
 Reporter:  [email-masked]  |      Owner:  Elwyn Davies
     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/282>
xml2rfc <http://tools.ietf.org/tools/xml2rfc/>

---

From: "xml2rfc issue tracker" <[email-masked]>
Date: Sat, 28 Feb 2015 22:05:58 -0000

Changes (by [email-masked]):

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

Comment:

 Fixed in [1802]:

 Catch bad arguments to the 'needlines' processing instruction.  Fixes
 issue #282.

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

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

---

From: "xml2rfc issue tracker" <[email-masked]>
Date: Sat, 28 Feb 2015 22:06:41 -0000

Description changed by [email-masked]:

Old description:

> packages/xml2rfc-2.4.9dev0-py2.7.egg/EGG-INFO/scripts/xml2rfc", line 239,
> in <module>
>     main()
> packages/xml2rfc-2.4.9dev0-py2.7.egg/EGG-INFO/scripts/xml2rfc", line 224,
> in main

New description:

 {{{
 }}}

--

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