Fix since Python2.7 doesnt support encoding kwarg to open()

This commit is contained in:
Chris Howell 2020-10-08 14:29:26 -07:00
parent eb01e08b04
commit 150c50cabe
1 changed files with 2 additions and 2 deletions

View File

@ -24,8 +24,8 @@ def load_asset(filename):
filepath = '{dirname}/assets/{filename}'.format(
dirname=os.path.dirname(__file__), filename=filename)
with open(filepath, encoding='utf-8') as file:
return file.read()
with open(filepath, mode="rb") as file:
return file.read().decode('utf-8')
class TestYouTubeTranscriptApi(TestCase):