mirror of
https://github.com/kennethreitz/dive-into-python3.git
synced 2026-06-05 23:10:17 +00:00
missing encoding parameter
This commit is contained in:
+1
-1
@@ -4,7 +4,7 @@ import re
|
||||
|
||||
# get list of chapters
|
||||
chapters = []
|
||||
for line in open('index.html'):
|
||||
for line in open('index.html', encoding="utf-8"):
|
||||
if not line.count('<li') or not line.count('<a href'): continue
|
||||
chapters.append(line.split('<a href=', 1)[1].split('>', 1)[0])
|
||||
sections = {}
|
||||
|
||||
Reference in New Issue
Block a user