Subject: [xml2rfc] text.py: endless loop in function paginate

From: Roger Price <[email-masked]>
Date: Fri, 8 Jan 2021 11:51:48 +0100 (CET)

Function paginate got into an endless loop so I added some calls to print, let 
it run and stopped the loop with a Ctl-c. I saw the attached output.

The source document is still "work in progress" but is structurally correct.
I hesitate to attach it since it's 1500 lines.

Roger

text.py: start_lineno=0 textlen=999 page=1
text.py: break_lineno=52 break_target=52
text.py: olen=7 wlen=1 blen=8 elem.tag=t
text.py: start_lineno=45 textlen=999 page=2
text.py: break_lineno=93 break_target=93
text.py: olen=4 wlen=119 blen=123 elem.tag=t
text.py: start_lineno=93 textlen=999 page=3
text.py: break_lineno=141 break_target=141
text.py: olen=52 wlen=71 blen=123 elem.tag=t
text.py: start_lineno=141 textlen=999 page=4
text.py: break_lineno=189 break_target=189
text.py: olen=100 wlen=23 blen=123 elem.tag=t
text.py: start_lineno=189 textlen=999 page=5
text.py: break_lineno=237 break_target=237
text.py: olen=0 wlen=6 blen=6 elem.tag=section
text.py: range(block.beg=237, break_target=237)
text.py: start_lineno=237 textlen=999 page=6
text.py: break_lineno=285 break_target=285
text.py: olen=6 wlen=1 blen=7 elem.tag=section
text.py: range(block.beg=279, break_target=285)
text.py: start_lineno=279 textlen=999 page=7
text.py: break_lineno=327 break_target=327
text.py: olen=0 wlen=4 blen=4 elem.tag=section
text.py: range(block.beg=327, break_target=327)
text.py: start_lineno=327 textlen=999 page=8
text.py: break_lineno=375 break_target=375
text.py: block=None
text.py: start_lineno=374 textlen=999 page=9
text.py: break_lineno=422 break_target=422
text.py: block=None
text.py: start_lineno=423 textlen=999 page=10
text.py: break_lineno=471 break_target=471
text.py: block=None
text.py: start_lineno=472 textlen=999 page=11
text.py: break_lineno=520 break_target=520
text.py: olen=0 wlen=1 blen=1 elem.tag=dt
text.py: start_lineno=520 textlen=999 page=12
text.py: break_lineno=568 break_target=568
text.py: olen=32 wlen=78 blen=110 elem.tag=section
text.py: range(block.beg=536, break_target=568)
text.py: start_lineno=536 textlen=999 page=13
text.py: break_lineno=584 break_target=584
text.py: olen=48 wlen=62 blen=110 elem.tag=section
text.py: range(block.beg=536, break_target=584)
text.py: start_lineno=536 textlen=999 page=14
text.py: break_lineno=584 break_target=584
text.py: olen=48 wlen=62 blen=110 elem.tag=section
text.py: range(block.beg=536, break_target=584)
text.py: start_lineno=536 textlen=999 page=15
text.py: break_lineno=584 break_target=584
text.py: olen=48 wlen=62 blen=110 elem.tag=section
text.py: range(block.beg=536, break_target=584)
text.py: start_lineno=536 textlen=999 page=16
...
text.py: break_lineno=584 break_target=584
text.py: olen=48 wlen=62 blen=110 elem.tag=section
text.py: range(block.beg=536, break_target=584)
text.py: start_lineno=536 textlen=999 page=9621
text.py: break_lineno=584 break_target=584
text.py: olen=48 wlen=62 blen=110 elem.tag=section
text.py: range(block.beg=536, break_target=584)
Traceback (most recent call last):
   File "/usr/bin/xml2rfc", line 11, in <module>
     sys.exit(main())
   File "/mnt/home/rprice/.local/lib/python3.5/site-packages/xml2rfc/run.py",
        line 739, in main writer.write(filename)
   File "/mnt/home/rprice/.local/lib/python3.5/site-packages/xml2rfc/writers/text.py",
        line 343, in write text = self.process()
   File "/mnt/home/rprice/.local/lib/python3.5/site-packages/xml2rfc/writers/text.py",
        line 305, in process lines = self.paginate(lines)
   File "/mnt/home/rprice/.local/lib/python3.5/site-packages/xml2rfc/writers/text.py",
        line 461, in paginate paginated += lines[start_lineno:break_lineno]
KeyboardInterrupt