mirror of
https://github.com/dh1tw/pyhamtools.git
synced 2026-01-06 16:50:04 +01:00
explicit encoding to UTF-8 on json.loads()
This commit is contained in:
parent
f6b0f4e23c
commit
28dbfc3265
|
|
@ -695,7 +695,7 @@ class LookupLib(object):
|
|||
if not self._check_html_response(response):
|
||||
raise LookupError
|
||||
|
||||
jsonLookup = json.loads(response.text)
|
||||
jsonLookup = json.loads(response.text, encoding='UTF-8')
|
||||
lookup = {}
|
||||
|
||||
for item in jsonLookup:
|
||||
|
|
@ -989,7 +989,7 @@ class LookupLib(object):
|
|||
return True
|
||||
|
||||
def _load_countryfile(self,
|
||||
url="http://www.country-files.com/cty/cty.plist",
|
||||
url="https://www.country-files.com/cty/cty.plist",
|
||||
country_mapping_filename="countryfilemapping.json",
|
||||
cty_file=None):
|
||||
""" Load and process the ClublogXML file either as a download or from file
|
||||
|
|
@ -1385,7 +1385,7 @@ class LookupLib(object):
|
|||
mapping = None
|
||||
|
||||
with open(country_mapping_filename, "r") as f:
|
||||
mapping = json.loads(f.read())
|
||||
mapping = json.loads(f.read(), encoding='UTF-8')
|
||||
|
||||
cty_list = plistlib.readPlist(cty_file)
|
||||
|
||||
|
|
@ -1473,7 +1473,7 @@ class LookupLib(object):
|
|||
Deserialize a JSON into a dictionary
|
||||
"""
|
||||
|
||||
my_dict = json.loads(json_data)
|
||||
my_dict = json.loads(json_data, encoding='UTF-8')
|
||||
|
||||
for item in my_dict:
|
||||
if item == const.ADIF:
|
||||
|
|
|
|||
|
|
@ -121,7 +121,7 @@ def get_clublog_users(**kwargs):
|
|||
files = zip_file.namelist()
|
||||
cl_json_unzipped = zip_file.read(files[0])
|
||||
|
||||
cl_data = json.loads(cl_json_unzipped)
|
||||
cl_data = json.loads(cl_json_unzipped, encoding='UTF-8')
|
||||
|
||||
error_count = 0
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue