Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

An empty column breaks xml2rfc (throws unhandled exception) #277

Closed
ietf-svn-bot opened this issue Nov 16, 2014 · 5 comments
Closed

An empty column breaks xml2rfc (throws unhandled exception) #277

ietf-svn-bot opened this issue Nov 16, 2014 · 5 comments
Labels

Comments

@ietf-svn-bot
Copy link

owner:henrik@levkowetz.com resolution_fixed type_defect | by cabo@tzi.org


An empty column breaks xml2rfc:

Parsing file min.xml
Traceback (most recent call last):
  File "/Users/cabo/bin/xml2rfc", line 225, in <module>
    main()
  File "/Users/cabo/bin/xml2rfc", line 210, in main
    pagedwriter.write(filename)
  File "/Users/cabo/lib/python2.7/site-packages/xml2rfc/writers/base.py", line 1180, in write
    self._build_index()
  File "/Users/cabo/lib/python2.7/site-packages/xml2rfc/writers/base.py", line 992, in _build_index
    self.write_section_rec(middle, None)
  File "/Users/cabo/lib/python2.7/site-packages/xml2rfc/writers/base.py", line 864, in write_section_rec
    level=level + 1, appendix=appendix)
  File "/Users/cabo/lib/python2.7/site-packages/xml2rfc/writers/base.py", line 842, in write_section_rec
    self.write_table(element)
  File "/Users/cabo/lib/python2.7/site-packages/xml2rfc/writers/paginated_txt.py", line 106, in write_table
    self.write_with_break_hint(BaseRfcWriter.write_table, 'raw', *args, **kwargs)
  File "/Users/cabo/lib/python2.7/site-packages/xml2rfc/writers/paginated_txt.py", line 81, in write_with_break_hint
    writer(self, *args, **kwargs)
  File "/Users/cabo/lib/python2.7/site-packages/xml2rfc/writers/base.py", line 772, in write_table
    self.draw_table(table, table_num=self.table_count)
  File "/Users/cabo/lib/python2.7/site-packages/xml2rfc/writers/raw_txt.py", line 1148, in draw_table
    for i in range(0, len(matrix))
  File "/Users/cabo/.homebrew/Cellar/python/2.7.8_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/textwrap.py", line 354, in wrap
    return w.wrap(text)
  File "/Users/cabo/.homebrew/Cellar/python/2.7.8_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/textwrap.py", line 329, in wrap
    return self._wrap_chunks(chunks)
  File "/Users/cabo/.homebrew/Cellar/python/2.7.8_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/textwrap.py", line 258, in _wrap_chunks
    raise ValueError("invalid width %r (must be > 0)" % self.width)
ValueError: invalid width 0 (must be > 0)
$ xml2rfc --version
2.4.8

Issue migrated from trac:277 at 2022-02-05 12:39:51 +0000

@ietf-svn-bot
Copy link
Author

@cabo@tzi.org uploaded file min.xml (1.3 KiB)

short test case

@ietf-svn-bot
Copy link
Author

@henrik@levkowetz.com changed status from new to closed

@ietf-svn-bot
Copy link
Author

@henrik@levkowetz.com changed resolution from `` to fixed

@ietf-svn-bot
Copy link
Author

@henrik@levkowetz.com commented


Fixed in bbb66ea:

Make sure we don't ask textwrap to wrap text with within a width of zero. Fixes issue #277.

@ietf-svn-bot
Copy link
Author

@henrik@levkowetz.com commented


From 44444a7:

Better resolusion of the zero-width table column issue. Related to issue #277.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant