From 0ec2a6ee56a0b522050b5059983fd11575dac64a Mon Sep 17 00:00:00 2001 From: chenxing Date: Wed, 28 Aug 2019 10:20:55 +0800 Subject: [PATCH] modify encoding with open cookies file --- src/you_get/common.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/you_get/common.py b/src/you_get/common.py index b2bca0a5..9409462d 100755 --- a/src/you_get/common.py +++ b/src/you_get/common.py @@ -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]