You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
IPinfo 4.4.0 version Unicodeerror on initializing handler. #72
Traceback (most recent call last):
File "<pyshell#2>", line 1, in <module>
handler = ipinfo.getHandler(access_token)
File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\ipinfo\__init__.py", line 7, in getHandler
return Handler(access_token, **kwargs)
File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\ipinfo\handler.py", line 68, in __init__
self.countries_currencies = handler_utils.read_json_file(
File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\ipinfo\handler_utils.py", line 107, in read_json_file
countries_json = f.read()
File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\encodings\cp1252.py", line 23, in decode
return codecs.charmap_decode(input,self.errors,decoding_table)[0]
UnicodeDecodeError: 'charmap' codec can't decode byte 0x8f in position 299: character maps to <undefined>
Temporary Fix
Step 1
Uninstall the IPinfo module version 4.4.0 with the following command:
pip uninstall ipinfo
Step 2
Install the previous stable release IPinfo version: 4.3.1 with the following command:
pip install ipinfo==4.3.1
You can check if your python library version with the following command as well:
pip show ipinfo
Which will output the following:
Name: ipinfo
Version: 4.3.1
.....
Then you should be ready to go if you are not using the added functions from the version 4.4.0 such as:
Activity