SLURM is a bit brain dead with its default widths for things, it seems that if you start tweaking with the format line, suddenly the lengths of things get shorter so parsing was no longer working properly.
On top of this shell=True changes the parsing of the list of commands and so that the shell was taking them as arguments instead of squeue, so a bit mess here.
Avoid shell=True by using os.environ.get for the username and allow for very long job names.
SLURM is a bit brain dead with its default widths for things, it seems that if you start tweaking with the format line, suddenly the lengths of things get shorter so parsing was no longer working properly.
On top of this shell=True changes the parsing of the list of commands and so that the shell was taking them as arguments instead of squeue, so a bit mess here.
Avoid shell=True by using os.environ.get for the username and allow for very long job names.