mirror of
https://github.com/kennethreitz/dive-into-python3.git
synced 2026-06-05 23:10:17 +00:00
horray for subtle UTF8-is-not-ASCII bugs
This commit is contained in:
+1
-1
@@ -5,7 +5,7 @@ import time
|
||||
|
||||
# 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])
|
||||
|
||||
Reference in New Issue
Block a user