Undefined variable 'utils' in html_decapsulator.py #42
Open
Description
File "C:\Users\User\Documents\parser.py", line 14, in <module>
renderer.render(parsed, f)
File "C:\Users\User\Documents\venv\Lib\site-packages\rtfparse\renderers\html_decapsulator.py", line 98, in render
self.render(item, file)
File "C:\Users\User\Documents\venv\Lib\site-packages\rtfparse\renderers\html_decapsulator.py", line 105, in render
self.render_symbol(item, file)
File "C:\Users\User\Documents\venv\Lib\site-packages\rtfparse\renderers\html_decapsulator.py", line 88, in render_symbol
utils.warn(f"Found an IGNORABLE control symbol which is not a group start!")
^^^^^
NameError: name 'utils' is not defined
I'm not sure what "utils" is meant to be, but I resolved this issue by adding the following to html_decapsulator.py:
class utils:
@staticmethod
def warn(message: str) -> str:
return f"WARNING: {message}"
@staticmethod
def error(message: str) -> str:
return f"ERROR: {message}"
Metadata
Assignees
Labels
No labels