Skip to content

ANSI escape detection doesn't work in byte strings #164

Closed

Description

@msimacek

The column length correctly considers ANSI escapes for strings:

>>> print(tabulate.tabulate([['asdf', '\x1b[31masdf\x1b[0m']]))
----  ----
asdf  asdf
----  ----

But not for bytes:

>>> print(tabulate.tabulate([[b'asdf', b'\x1b[31masdf\x1b[0m']]))
----  -------------
asdf  asdf
----  -------------

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions