Skip to content

Change subprocess.check_output option for bytes/string mismatch #3285

Open
@marinelay

Description

@marinelay

luigi/luigi/contrib/sge.py

Lines 314 to 322 in 64d6c48

def _track_job(self):
while True:
# Sleep for a little bit
time.sleep(self.poll_time)
# See what the job's up to
# ASSUMPTION
qstat_out = subprocess.check_output(['qstat'])
sge_status = _parse_qstat_state(qstat_out, self.job_id)

In luigi.contrib.sge.py at line 321, text=True option have to be given in subprocess.check_output(['qstat']) because _parse_qstat_state function only allow string type.
The current code always raise TypeError in _parse_qstat_state when running _track_job method.

If there is no reason qstat_out variable should be bytes type, I believe it is ideal to change subprocess.check_output(['qstat']) to subprocess.check_output(['qstat'], text=True).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions