I'm trying to convert my Python 2 code to Python3 but I am receiving the following error:
Traceback (most recent call last):
File "markovtest.py", line 73, in <module>
get_all_tweets("quit_cryan")
File "markovtest.py", line 41, in get_all_tweets
outtweets = [(tweet.text.encode("utf-8") + str(b" ")) for tweet in alltweets]
File "markovtest.py", line 41, in <listcomp>
outtweets = [(tweet.text.encode("utf-8") + str(b" ")) for tweet in alltweets]
TypeError: can't concat bytes to str
The problem is in this for loop:
outtweets = [(tweet.text.encode("utf-8") + " ") for tweet in alltweets]
I have tried changing encode to decode or removing the encode parameter altogether but I cannot figure it out. Any help would be appreciated.