testsupervisor.py simply overwrites the last line in stdout.
#!/usr/bin/env python3
import time
from datetime import datetime as dt
cl_deleol= "\033[K" # delete line
cl_reset='\033[0m' # reset color
cl_moveup= "\033[1A" # move cursor one line up
def overwrite(s):
return cl_moveup + cl_deleol + str(s) + cl_reset
while 1:
print(overwrite(f"testsupervisor {dt.now().strftime('%H:%M:%S')}"))
#print(f"testsupervisor {dt.now().strftime('%H:%M:%S')}")
time.sleep(1)
Running this test script will cause the tail test to fail. The use case for this is to show a last timestamp on stdout msgs that have no timestamp withtout littering the screen with no activity timestamps. Interestingly a tail -f test works fine.
This is a reproducible error with code below. Getting this error which I isolated down to a ctrl char in the output.
supervisor> tail test error: <class 'xml.parsers.expat.ExpatError'>, not well-formed (invalid token): line 5, column 36: file: /usr/lib64/python3.9/xmlrpc/client.py line: 451
python: Python 3.9.16 supervisor==4.2.5
file mode on sock
srwx------ 1 sx sx 0 Nov 16 11:03 /home/devop/var/run/supervisor.http.sock
kernal : 5.14.0-284.25.1.0.1.el9_2.x86_64 oracle linux 8
conf file of app.
testsupervisor.py simply overwrites the last line in stdout.
Running this test script will cause the
tail test
to fail. The use case for this is to show a last timestamp on stdout msgs that have no timestamp withtout littering the screen with no activity timestamps. Interestingly atail -f test
works fine.