Subject: [xml2rfc] #239: Error when source is None

From: "xml2rfc issue tracker" <[email-masked]>
Date: Thu, 20 Feb 2014 00:10:07 -0000

#239: Error when source is None

 At writers/raw_txt.py:438 -

 {{{
 source = element.attrib.get('source', None)
 if source:
     source = " --" + source
 if element.text:
     try:
         line.append('[[' + anchor + element.text + source + ']]')
 }}}

 Source defaults to None, but if it turns out to be (such as with a cref
 element),  you get:

 {{{
 File "/usr/local/lib/python2.7/site-packages/xml2rfc/writers/raw_txt.py",
 line 443, in _combine_inline_elements
   line.append('[[' + anchor + element.text + source + ']]')
 TypeError: cannot concatenate 'str' and 'NoneType' objects
 }}}

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

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

---

From: "xml2rfc issue tracker" <[email-masked]>
Date: Thu, 20 Feb 2014 00:58:20 -0000

Comment (by [email-masked]):

 I fixed with:

 {{{
 if source:
     source = " --" + source
 else:
     source = ""
 }}}

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

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

---

From: "xml2rfc issue tracker" <[email-masked]>
Date: Thu, 20 Feb 2014 01:00:20 -0000

#239: TypeError when source is None

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