string.center(width) is giving me a 'NoneType' object has no attribute 'center' error on Python 3

Find and Replace is a wonderful thing. That fixed that issue, but now another issue is presenting itself. This same code worked fine on Python x64 on Tuesday and before on Python 2.7 x86. I appreciate your help, could you please look at this one for me too? Line 378: if ("unreachable" in ping) or ("timed" in ping) or ("failure" in ping): Gives me this error: TypeError: a bytes-like object is required, not 'str' The purpose of that line is if the command ping gives any of these on the response then the device is offline.

Thank you very much. I appreciate it. KimPeek also pointed that out and that corrected that issue, but then another issue shows up and, again, it is an error I have not seen before.

Find and Replace is a wonderful thing. That fixed that issue, but now another issue is presenting itself. This same code worked fine on Python x64 on Tuesday and before on Python 2.7 x86. I appreciate your help, could you please look at this one for me too? Line 378: if ("unreachable" in ping) or ("timed" in ping) or ("failure" in ping): Gives me this error: TypeError: a bytes-like object is required, not 'str' The purpose of that line is if the command ping gives any of these on the response then the device is offline.

/r/learnpython Thread Parent