Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
marinelay opened this issue Apr 8, 2024 · 1 comment
Open

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

marinelay opened this issue Apr 8, 2024 · 1 comment

Comments

@marinelay
Copy link

marinelay commented Apr 8, 2024

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).

@marinelay
Copy link
Author

Wait, I found that this bug was already discussed and even given a pull request 6 years ago (#2480).
I think it doesn't seem to be well maintained for some reason.
I'll close the issue if it doesn't get fixed for a while.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant