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

TypeError: expected string or buffer when parsing simple field instr #199

Open
kylegibson opened this issue Dec 9, 2015 · 1 comment
Open
Labels

Comments

@kylegibson
Copy link
Contributor

No example document available currently, but my guess is that instr is None.

  File "/home/policystat/env/lib/python2.7/site-packages/pydocx/export/html.py", line 211, in export
    for result in super(PyDocXHTMLExporter, self).export()
  File "/home/policystat/env/lib/python2.7/site-packages/pydocx/export/html.py", line 209, in <genexpr>
    result.to_html() if isinstance(result, HtmlTag)
  File "/home/policystat/env/lib/python2.7/site-packages/pydocx/export/base.py", line 119, in export
    for result in self.export_node(document):
  File "/home/policystat/env/lib/python2.7/site-packages/pydocx/export/base.py", line 214, in export_node
    for result in results:
  File "/home/policystat/env/lib/python2.7/site-packages/pydocx/export/html.py", line 127, in apply
    for result in results:
  File "/home/policystat/env/lib/python2.7/site-packages/pydocx/export/base.py", line 214, in export_node
    for result in results:
  File "/home/policystat/env/lib/python2.7/site-packages/pydocx/export/html.py", line 127, in apply
    for result in results:
  File "/home/policystat/env/lib/python2.7/site-packages/pydocx/export/base.py", line 248, in yield_nested
    for result in func(item):
  File "/home/policystat/env/lib/python2.7/site-packages/pydocx/export/base.py", line 214, in export_node
    for result in results:
  File "/home/policystat/env/lib/python2.7/site-packages/pydocx/export/html.py", line 278, in export_paragraph
    results = is_not_empty_and_not_only_whitespace(results)
  File "/home/policystat/env/lib/python2.7/site-packages/pydocx/export/html.py", line 78, in is_not_empty_and_not_only_whitespace
    for item in gen:
  File "/home/policystat/env/lib/python2.7/site-packages/pydocx/export/base.py", line 248, in yield_nested
    for result in func(item):
  File "/home/policystat/env/lib/python2.7/site-packages/pydocx/export/base.py", line 212, in export_node
    results = caller(node)
  File "/home/policystat/env/lib/python2.7/site-packages/pydocx/export/base.py", line 513, in export_simple_field
    parsed_instr = simple_field.parse_instr()
  File "/home/policystat/env/lib/python2.7/site-packages/pydocx/openxml/wordprocessing/simple_field.py", line 41, in parse_instr
    m = self._parse_instr_into_field_type_and_arg_string()
  File "/home/policystat/env/lib/python2.7/site-packages/pydocx/openxml/wordprocessing/simple_field.py", line 35, in _parse_instr_into_field_type_and_arg_string
    return re.match('^\s*([^\s]+)\s*(.*)$', self.instr)
  File "/home/policystat/env/lib/python2.7/re.py", line 137, in match
    return _compile(pattern, flags).match(string)
TypeError: expected string or buffer
@kylegibson kylegibson added the bug label Dec 9, 2015
@winhamwr
Copy link
Contributor

I think #219 might contain an example of a document demonstrating this bug.

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

2 participants