psathyrella / partis

B- and T-cell receptor sequence annotation, simulation, clonal family and germline inference, and affinity prediction
GNU General Public License v3.0
55 stars 34 forks source link

Run fail on torque queuing system because of "stty size" command #188

Closed krdav closed 8 years ago

krdav commented 8 years ago

Got an error while running partis on a batch system. Don't have the actual error output because I corrected it and then ran smoothly.

This is the line that causes the error:

rows, columns = [int(v) for v in check_output(['stty', 'size']).split()]  # get actual tty height and width

I just fixed the values but one could make a try/except to make it more robust.

krdav commented 8 years ago

Something like this will do:

try:
    rows, columns = [int(v) for v in check_output(['stty', 'size']).split()]  # get actual tty height and width
except:
    rows, columns = [50, 200]                                                 # Set to default if "stty size" does not return anything
psathyrella commented 8 years ago

yes! nice catch, thanks. I hadn't realized stty didn't port to non-login terminals. It doesn't look like you can do it portably, though, so yeah, try/except it is.