Issue
My Python script produces unknown column
error on redhat 8.5 python 3.6.8.
But works without issue on Ubuntu 20.04 with python 3.8.10
Would this be a python or redhat issue? Is it possible to gather more detailed logs?
Link to full script https://github.com/michael-pellegrini/scripts/blob/master/xtime.py
#!/usr/bin/env python3
import subprocess, re, os
def main():
storage()
def storage():
output = str.splitlines(os.fsdecode(subprocess.check_output(['lsblk', '-fm', '-o' 'NAME,' 'FSTYPE,' 'FSAVAIL,' 'FSUSE%,' 'MOUNTPOINT,' 'SIZE,' 'OWNER,' 'GROUP,' 'MODE', '-e 7'])))
print(esc('1;93') + " List of drives, partitions, and details" + esc(0))
for line in output:
print(" " + line)
print('')
def esc(code):
return f'\033[{code}m'
if __name__=='__main__':
main()
Solution
Answer is in @larsks comment. lsblk version 2.32.1 vs 2.34
Answered By - m0ng00se Answer Checked By - David Marino (WPSolving Volunteer)