Provide file opening mode

This commit is contained in:
Oleg Morozenkov
2016-02-22 12:06:17 +03:00
parent 3cd33d2048
commit e21cab86d0
4 changed files with 8 additions and 6 deletions

View File

@@ -10,7 +10,7 @@ tokenizer = RegexpTokenizer(r"[A-Za-zА-Яа-я]+")
stemmer = RussianStemmer()
musicFileName = sys.argv[0]
with open(musicFileName) as file:
with open(musicFileName, "r") as file:
for line in file:
jsonData = json.loads(line, encoding="utf8")
for song in jsonData.values()[0]: