astanin / python-tabulate

Pretty-print tabular data in Python, a library and a command-line utility. Repository migrated from bitbucket.org/astanin/python-tabulate.
https://pypi.org/project/tabulate/
MIT License
2.1k stars 163 forks source link

Logs not rendering properly in OpenShift console. #277

Closed te-ak closed 1 year ago

te-ak commented 1 year ago

Hello Python-Tabulate team,

I have a table that generates perfectly in my local environment (macOS using PyCharm's run-console).

When I deploy the container to my OpenShift Container Engine, the output gets mangled like this:

From the OpenShift logs web viewer:

┍━━━━┯━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━━━━━━━━━━━━┑
│ │ Okta group name │ Okta total users │ Okta humans* │ Mailer name │ Mailer current members† │
┝━━━━┿━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┿━━━━━━━━━━━━━━━━━━━━┿━━━━━━━━━━━━━━━━┿━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┿━━━━━━━━━━━━━━━━━━━━━━━━━━━┥
│ 0 │ 1300 - Professional Services │ 35 │ 35 │ professionalservices │ 35 │
│ 1 │ 1500 - Operations │ 44 │ 43 │ operations │ 43 │
│ 2 │ 2300 - Engineering │ 269 │ 257 │ engineering │ 257 │
│ 3 │ 6130 - IT │ 4 │ 4 │ it │ 4 │
│ 4 │ Everyone │ 2561 │ 1533 │ everyone │ 1533 │
│ 5 │ Everyone (excl: Contractors) │ 1024 │ 995 │ everyoneexclcontractors │ 995 │
┕━━━━┷━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━━━━━━━━━━━━┙

Raw:

┍━━━━┯━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━━━┑
│    │ Okta group name              │   Okta total users │   Okta humans* │ Mailer name                               │   Mailer current members† │   Mailer joiners │   Mailer leavers │
┝━━━━┿━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┿━━━━━━━━━━━━━━━━━━━━┿━━━━━━━━━━━━━━━━┿━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┿━━━━━━━━━━━━━━━━━━━━━━━━━━━┿━━━━━━━━━━━━━━━━━━┿━━━━━━━━━━━━━━━━━━┥
│  0 │ 1300 - Professional Services │                 35 │             35 │test-professionalservices    │                        35 │                0 │                0 │
│  1 │ 1500 - Operations            │                 44 │             43 │test-operations              │                        43 │                0 │                0 │
│  2 │ 2300 - Engineering           │                269 │            257 │test-engineering             │                       257 │                0 │                0 │
│  3 │ 6130 - IT                    │                  4 │              4 │test-it                      │                         4 │                0 │                0 │
│  4 │ Everyone                     │               2561 │           1533 │test-everyone                │                      1533 │                0 │                0 │
│  5 │ Everyone (excl: Contractors) │               1024 │            995 │test-everyoneexclcontractors │                       995 │                0 │                0 │
┕━━━━┷━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━━━┙

Do you have any suggestions for how I can troubleshoot this?

eliegoudout commented 1 year ago

Have you tried to switch to "simpler" tablefmt? The characters used for the nicer tables might not be native utf8, and this might code issues.

te-ak commented 1 year ago

Sadly, the same behavior occurs when using github

If you look at the output, you can see that the only messed up part is the missing spaces to ensure each column line/border is formatted and lined up.

I don't know what tabulate is using for the whitespace, but OpenShift is discarding it.

te-ak commented 1 year ago

I escalated to OpenShift. This was determined to be a bug by their team: https://issues.redhat.com/browse/OCPBUGS-17676