modify encoding with open cookies file

This commit is contained in:
chenxing 2019-08-28 10:20:55 +08:00
parent 0c0209be22
commit 0ec2a6ee56

View File

@ -1317,7 +1317,7 @@ def load_cookies(cookiefile):
cookies = cookiejar.MozillaCookieJar()
now = time.time()
ignore_discard, ignore_expires = False, False
with open(cookiefile, 'r') as f:
with open(cookiefile, 'r', encoding='utf-8') as f:
for line in f:
# last field may be absent, so keep any trailing tab
if line.endswith("\n"): line = line[:-1]