hassanakbar4 / tractive-test

0 stars 0 forks source link

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

Closed hassanakbar4 closed 3 years ago

hassanakbar4 commented 6 years ago

component_Version 2 cli resolution_worksforme type_defect | by pusateri@bangj.com


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

Issue migrated from trac:358 at 2021-10-20 18:27:44 +0500

hassanakbar4 commented 6 years ago

@{"email"=>"pusateri@bangj.com", "name"=>nil, "username"=>nil} uploaded file draft-ietf-dnssd-push.xml (78.4 KiB)

draft-ietf-dnssd-push.xml

hassanakbar4 commented 6 years ago

@{"email"=>"pusateri@bangj.com", "name"=>nil, "username"=>nil} commented


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.

hassanakbar4 commented 6 years ago

@{"email"=>"henrik@levkowetz.com", "name"=>nil, "username"=>nil} commented


Hi Tom,

I can't reproduce this with my current code (based on 2.10.0). Which version of xml2rfc were you using when you saw this?

hassanakbar4 commented 6 years ago

@{"email"=>"pusateri@bangj.com", "name"=>nil, "username"=>nil} commented


I can't reproduce it either now. You can close it. If it comes back, I'll re-open.

hassanakbar4 commented 6 years ago

@{"email"=>"henrik@levkowetz.com", "name"=>nil, "username"=>nil} changed status from new to closed

hassanakbar4 commented 6 years ago

@{"email"=>"henrik@levkowetz.com", "name"=>nil, "username"=>nil} changed resolution from ` toworksforme`

hassanakbar4 commented 6 years ago

@{"email"=>"henrik@levkowetz.com", "name"=>nil, "username"=>nil} commented


I think this was addressed more generically in 2.10.0