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

UnicodeEncodeError: 'ascii' codec can't encode character #121

Closed
rrolla opened this issue Jul 23, 2018 · 3 comments · Fixed by #177
Closed

UnicodeEncodeError: 'ascii' codec can't encode character #121

rrolla opened this issue Jul 23, 2018 · 3 comments · Fixed by #177

Comments

@rrolla
Copy link

rrolla commented Jul 23, 2018

Hi, seems it cannot parse unicode values
example
.env file

SHARE_ENDPOINTS="'Bibliotēka', 'Reģistrētie dokumenti'"

settings.py file

#!/usr/bin/env python2

import os
from dotenv import load_dotenv, find_dotenv
load_dotenv(find_dotenv())

SHARE_ENDPOINTS = os.getenv("SHARE_ENDPOINTS")
print(SHARE_ENDPOINTS)

Error traceback

Traceback (most recent call last):
  File "./bin/settings.py", line 5, in <module>
    load_dotenv(find_dotenv())
  File "/home/rolla/.local/lib/python2.7/site-packages/dotenv/main.py", line 250, in load_dotenv
    return DotEnv(f, verbose=verbose).set_as_environment_variables(override=override)
  File "/home/rolla/.local/lib/python2.7/site-packages/dotenv/main.py", line 97, in set_as_environment_variables
    os.environ[k] = v
  File "/usr/lib/python2.7/os.py", line 473, in __setitem__
    putenv(key, item)
UnicodeEncodeError: 'ascii' codec can't encode character u'\u0113' in position 8: ordinal not in range(128)

Is there some options to get this working?
Thanks.

@imaben
Copy link

imaben commented Sep 13, 2018

+1

@bdtian
Copy link

bdtian commented Dec 19, 2018

+1

@bbc2
Copy link
Collaborator

bbc2 commented May 4, 2019

I could confirm this bug when investigating #176 and it's actually not fixed by #144. I'll look into it.

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

Successfully merging a pull request may close this issue.

4 participants