Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'ascii' codec can't decode byte 0xe6 in position 75: ordinal not in range(128) #6

Open
CPapadim opened this issue Jul 29, 2019 · 3 comments

Comments

@CPapadim
Copy link

CPapadim commented Jul 29, 2019

I get the error in the title when calling x = CountryInfo()

I'm able to fix this by adding 'rb' to the open() statement that reads the country json files.

@ryanakuhl
Copy link

Thanks, adding it to line 30 of countryinfo.py worked for me.

@aster94
Copy link

aster94 commented Mar 8, 2020

same error here on python 3.7.3 installing the lib from pip

runfile('C:/Users/vincenzo/.spyder-py3/temp.py', wdir='C:/Users/vincenzo/.spyder-py3')
Traceback (most recent call last):

  File "C:\Users\vincenzo\.spyder-py3\temp.py", line 11, in <module>
    country = CountryInfo('Italy')

  File "C:\Users\vincenzo\Miniconda3\lib\site-packages\countryinfo\countryinfo.py", line 30, in __init__
    country_info = json.load(open(file_path))

  File "C:\Users\vincenzo\Miniconda3\lib\json\__init__.py", line 293, in load
    return loads(fp.read(),

  File "C:\Users\vincenzo\Miniconda3\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 0x81 in position 49: character maps to <undefined>

@emorell96
Copy link

Same issue here. UnicodeDecodeError: 'charmap' codec can't decode byte 0x81 in position 49: character maps to

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants