Subject: [xml2rfc] #358 (Version 2 cli): xml2rfc v2.10.0 needLines causes a python 3 traceback

From: "xml2rfc issue tracker" <[email-masked]>
Date: Mon, 13 Aug 2018 00:54:21 -0000

#358: xml2rfc v2.10.0 needLines causes a python 3 traceback

 {{{
 xml2rfc draft-ietf-dnssd-push.xml -o draft-ietf-dnssd-push.txt --text
 Parsing file draft-ietf-dnssd-push.xml
 Traceback (most recent call last):
   File "/Users/pusateri/.virtualenvs/rfc/bin/xml2rfc", line 11, in
 <module>
     sys.exit(main())
   File "/Users/pusateri/.virtualenvs/rfc/lib/python3.6/site-
 packages/xml2rfc/run.py", line 337, in main
     pagedwriter.write(filename)
   File "/Users/pusateri/.virtualenvs/rfc/lib/python3.6/site-
 packages/xml2rfc/writers/base.py", line 1343, in write
     self._build_index()
   File "/Users/pusateri/.virtualenvs/rfc/lib/python3.6/site-
 packages/xml2rfc/writers/base.py", line 1176, in _build_index
     s_count = self.write_section_rec(back, None, appendix=True,
 emit_numbered="only")
   File "/Users/pusateri/.virtualenvs/rfc/lib/python3.6/site-
 packages/xml2rfc/writers/base.py", line 946, in write_section_rec
     self.needLines(pidict["needLines"])
   File "/Users/pusateri/.virtualenvs/rfc/lib/python3.6/site-
 packages/xml2rfc/writers/paginated_txt.py", line 107, in needLines
     self._set_break_hint(count, 'raw', len(self.buf))
   File "/Users/pusateri/.virtualenvs/rfc/lib/python3.6/site-
 packages/xml2rfc/writers/paginated_txt.py", line 84, in _set_break_hint
     if need > needLines:
 TypeError: '>' not supported between instances of 'int' and 'str'
 make: *** [draft-ietf-dnssd-push.txt] Error 1
 }}}

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

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

---

From: "xml2rfc issue tracker" <[email-masked]>
Date: Mon, 13 Aug 2018 03:29:17 -0000

Comment (by [email-masked]):

 Upgrading to Python 3.7 didn't help.
 Downgrading XML2RFC showed the same bug all the way back to 2.6.2. I
 didn't try earlier versions.
 Changing xml2rfc/writers/paginated_txt.py:84 to:
 {{{
 if int(need) > int(needLines):
 }}}
 seems to fix the problem.

-- 
---------------------------------+----------------------------------
Resolution:                      |   Keywords:
---------------------------------+----------------------------------

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