Adding fix for writing UTF-8 encoded strings when keeping tweet history
parent
646518ffe6
commit
91a325e937
|
@ -2,6 +2,7 @@ import helpers
|
|||
import requests
|
||||
from bs4 import BeautifulSoup
|
||||
from pathlib import Path
|
||||
import codecs
|
||||
|
||||
|
||||
def getTweets():
|
||||
|
@ -97,7 +98,7 @@ def tootTheTweet(tweet):
|
|||
|
||||
else:
|
||||
|
||||
tweet_check = open(tweet_check_file_path, 'w')
|
||||
tweet_check = codecs.open(tweet_check_file_path, mode='w', encoding='utf-8')
|
||||
tweet_check.write(tweet['text'])
|
||||
tweet_check.close()
|
||||
|
||||
|
|
Loading…
Reference in New Issue