Skip to content

Commit

Permalink
fix UnicodeEncodeError
Browse files Browse the repository at this point in the history
  • Loading branch information
oooldking committed May 8, 2018
1 parent eff422a commit 5ecbfa4
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ip_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
import urllib2
import json
import sys
reload(sys)
sys.setdefaultencoding('utf-8')

ip_api = urllib2.urlopen(r'http://ip-api.com/json')

Expand Down

0 comments on commit 5ecbfa4

Please sign in to comment.