Skip to content

Commit

Permalink
fix(ip.py): ignore non-utf format encoding (#288)
Browse files Browse the repository at this point in the history
Co-authored-by: Red_Hairy_Mouse <56833537+cjw-bot@users.noreply.github.com>
  • Loading branch information
chimaoshu and chimaoshu authored Oct 12, 2021
1 parent 5b03cd2 commit 914f3c0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion util/ip.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def _open(url, reg):
debug("open: %s", url)
res = urlopen(
Request(url, headers={'User-Agent': 'curl/7.63.0-ddns'}), timeout=60
).read().decode('utf8')
).read().decode('utf8', 'ignore')
debug("response: %s", res)
return compile(reg).search(res).group()
except Exception as e:
Expand Down

0 comments on commit 914f3c0

Please sign in to comment.