The answer on this post, https://stackoverflow.com/a/16175368/6448312 is failing to run for me on Python 3. I'm getting the error of -
#$>test2.py Traceback (most recent call last): File "C:\Users\.\OneDrive\PROJECTS for fun\smartApp\test2.py", line 4, in <module>
for row in output.split('\n'): TypeError: a bytes-like object is required, not 'str'
I am using the same code they posted - https://hastebin.com/ubafadikos.py
It seems like I need to cast the string to a byte type, I've tried using, newOutput = bytes(output, 'utf-8')
but that is failing too with the error message of
newOutput = bytes(output, 'utf-8')
TypeError: str() takes at most 1 argument (2 given)
I'm at a loss for what to try next :( I'm using Python 3.6.1, running the code on Python 2.7 works fine.
EDIT: Using newOutput = bytes(output) works