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

AttributeError: 'list' object has no attribute 'replace' #242

Open
fenchu opened this issue Feb 15, 2024 · 1 comment
Open

AttributeError: 'list' object has no attribute 'replace' #242

fenchu opened this issue Feb 15, 2024 · 1 comment

Comments

@fenchu
Copy link

fenchu commented Feb 15, 2024

/root/.pyenv/shims/python3 ./html-report.py --host="https://$acmehostname.$acmedomain/" --fname="$TESTENV.html" --directory=$SERVER

deploy is a string.

python 3,12,2 linux ubuntu 22.04LTS

Traceback (most recent call last):
  File "/builds/tlsvid/acme/acme-azure-auto-test/./html-report.py", line 31, in <module>
    deploy = Ansi2HTMLConverter(linkify=True, inline=True).convert(deploy)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.pyenv/versions/base/lib/python3.12/site-packages/ansi2html/converter.py", line 627, in convert
    attrs = self.prepare(ansi, ensure_trailing_newline=ensure_trailing_newline)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.pyenv/versions/base/lib/python3.12/site-packages/ansi2html/converter.py", line 604, in prepare
    body, styles = self.apply_regex(ansi)
                   ^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.pyenv/versions/base/lib/python3.12/site-packages/ansi2html/converter.py", line 353, in apply_regex
    no_cursor_parts = self._collapse_cursor(all_parts)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.pyenv/versions/base/lib/python3.12/site-packages/ansi2html/converter.py", line 574, in _collapse_cursor
    for part in parts:
  File "/root/.pyenv/versions/base/lib/python3.12/site-packages/ansi2html/converter.py", line 396, in _apply_regex
    ansi = ansi.replace(pattern, special)
           ^^^^^^^^^^^^
AttributeError: 'list' object has no attribute 'replace'

probalby do a check of the

@fenchu
Copy link
Author

fenchu commented Feb 16, 2024

I can fix it doing an explicit "".join(ansi)

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

No branches or pull requests

1 participant