Subject: [Tools-discuss] Rfcmarkup-1.121 feedback

From: Michael Thornburgh <[email-masked]>
Date: Thu, 23 Mar 2017 18:01:39 +0000

hi tools folks.

it appears that the rfcmarkup tool is crashing when displaying RFC 7016 (of which i am the author).  i haven't found any other RFCs that it crashes on.

the crashing behavior seems to have started just in the last few weeks.  i remember reading the HTML-ized version a few weeks ago with no problem.  i'm not sure if it was cached by my browser at the time, though.

here is the error page that is displayed for https://tools.ietf.org/html/rfc7016 :

<class 'sre_constants.error'>	Python 2.7.10+: /usr/local/bin/python
Sun Mar 12 00:35:03 2017
A problem occurred in a Python script. Here is the sequence of function calls leading up to the error, in the order they occurred.

 /www/tools.ietf.org/tools/rfcmarkup/rfcmarkup in ()
   1478         usage()
   1479         sys.exit()
   1480 
=> 1481     markup()
   1482     
markup = <function markup>
 /www/tools.ietf.org/tools/rfcmarkup/rfcmarkup in markup()
   1359                 "<a href=\"%s?%s%s=\g<9>\g<1>\">\g<2>&nbsp;\g<3>\g<5>\g<8>\g<9></a>" % (script, extra, n), data)
   1360             data = re.sub("(?i)<a href=\"([^\"]*)\"[^>]*>(section)</a>(\n\s+)<a href=\"(?:[^\"]*)\"[^>]*>(\d+(\.\d+)*)</a>(\.?\s+(of|in)\s+)<a href=\"([^\"]*)\"[^>]*>(%s[- ]?)([0-9]+)</a>"%n,
=> 1361                 "<a href=\"%s?%s%s=\g<10>\g<1>\">\g<2></a>\g<3><a href=\"%s?%s%s=\g<10>\g<1>\">\g<4>\g<5>\g<9>\g<10></a>" % (script, extra, n, script, extra, n), data)
   1362             # appendix x of rfc y markup
   1363             data = re.sub("(?i)<a href=\"([^\"]*)\"[^>]*>(appendix)\s([A-Z](\.\d+)*)</a>(\.?\s+(of|in)\s+)<a href=\"([^\"]*)\"[^>]*>(%s[- ]?)([0-9]+)</a>"%n,
script = '/html', extra = '', n = 'rfc', data = u'Internet Engineering Task Force (IETF) ... Informational [Page 113]\n'
 /usr/lib/python2.7/re.py in sub(pattern='(?i)<a href="([^"]*)"[^>]*>(section)</a>(\n\\s+)<a...\\s+)<a href="([^"]*)"[^>]*>(rfc[- ]?)([0-9]+)</a>', repl=r'<a href="/html?rfc=\g<10>\g<1>">\g<2></a>\g<3><a..."/html?rfc=\g<10>\g<1>">\g<4>\g<5>\g<9>\g<10></a>', string=u'Internet Engineering Task Force (IETF) ... Informational [Page 113]\n', count=0, flags=0)
    153     a callable, it's passed the match object and must return
    154     a replacement string to be used."""
=>  155     return _compile(pattern, flags).sub(repl, string, count)
    156 
    157 def subn(pattern, repl, string, count=0, flags=0):
global _compile = <function _compile>, pattern = '(?i)<a href="([^"]*)"[^>]*>(section)</a>(\n\\s+)<a...\\s+)<a href="([^"]*)"[^>]*>(rfc[- ]?)([0-9]+)</a>', flags = 0, ).sub undefined, repl = r'<a href="/html?rfc=\g<10>\g<1>">\g<2></a>\g<3><a..."/html?rfc=\g<10>\g<1>">\g<4>\g<5>\g<9>\g<10></a>', string = u'Internet Engineering Task Force (IETF) ... Informational [Page 113]\n', count = 0
 /usr/lib/python2.7/re.py in filter(match=<_sre.SRE_Match object>, template=([(1, 10), (2, 1), (4, 2), (6, 3), (8, 10), (9, 1), (11, 4), (12, 5), (13, 9), (14, 10)], ['<a href="/html?rfc=', None, None, '">', None, '</a>', None, '<a href="/html?rfc=', None, None, '">', None, None, None, None, '</a>']))
    289         return template[1][0]
    290     def filter(match, template=template):
=>  291         return sre_parse.expand_template(template, match)
    292     return filter
    293 
global sre_parse = <module 'sre_parse' from '/usr/lib/python2.7/sre_parse.pyc'>, sre_parse.expand_template = <function expand_template>, template = ([(1, 10), (2, 1), (4, 2), (6, 3), (8, 10), (9, 1), (11, 4), (12, 5), (13, 9), (14, 10)], ['<a href="/html?rfc=', None, None, '">', None, '</a>', None, '<a href="/html?rfc=', None, None, '">', None, None, None, None, '</a>']), match = <_sre.SRE_Match object>
 /usr/lib/python2.7/sre_parse.py in expand_template(template=([(1, 10), (2, 1), (4, 2), (6, 3), (8, 10), (9, 1), (11, 4), (12, 5), (13, 9), (14, 10)], ['<a href="/html?rfc=', None, None, '">', None, '</a>', None, '<a href="/html?rfc=', None, None, '">', None, None, None, None, '</a>']), match=<_sre.SRE_Match object>)
    829             literals[index] = s = g(group)
    830             if s is None:
=>  831                 raise error, "unmatched group"
    832     except IndexError:
    833         raise error, "invalid group reference"
global error = <class 'sre_constants.error'>
<class 'sre_constants.error'>: unmatched group 
      args = ('unmatched group',) 
      message = 'unmatched group'

-michael thornburgh