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
[bug] UnicodeEncodeError upon dynaconf init #664
Comments
I suspect this problem is related to the emojis on https://github.com/rochacbruno/dynaconf/blob/master/dynaconf/cli.py#L283 We need to find a way to safely output the emojis on windows, make it optional or remove it completelly. |
I'm trying to reproduce this, and will go study to correct. |
This issue seems to have been fixed in latest Windows updates. microsoft/terminal#190 I'm researching if this fix is only in Newer Builds. (I'm using Windows 11), and seeing how we can work around to not break the execution in older builds. @ebenh What your windows version for me reproduce this in Virtual Machine? |
Windows 7 x64 |
@ebenh you are using python 37, 38 or 39? Edit: I managed to reproduce the error with Python379 on Windows 7 Ultimate x64, I will try to bypass it. |
@ebenh to bypass this error i found this solution: You can use:
or
Source: Stackoverflow @rochacbruno We can add this env directly into Dynaconf or put a manual for use on Windows systems with older builds, I think this can also happen on Windows 8 and Windows 8.1. |
@endersonmenezes does it work if we put Or as a second option, remove all the emojis from the CLI output? What do you think? Probably getting rid of emojis is safer option pypa/pipenv#3131 |
I think we can keep the emojis and use PYTHONIOENCODING, as our String is passed by IO, just when it's not able to decode it will remove it, so we have the two solutions:
I think EDIT: The result would be similar to this change, simpler. https://github.com/pypa/pipenv/pull/3132/files |
Shortlog of commits since last release: Anderson Sousa (1): Document the usage with python -m (#710) Andressa Cabistani (2): Add unique label when merging lists to fix issue #653 (#661) Add new validation to fix issue #585 (#667) Armin Berres (1): Fix typo in error message Bruno Rocha (7): Release version 3.1.7 Found this bug that was duplicating the generated envlist (#663) Add support for Python 3.10 (#665) Attempt to fix #555 (#669) Create update_contributors.yml Fixing pre-coomit and docs CI Added `dynaconf get` command to cli (#730) Caneco (2): improvement: add brand new logo to the project (#686) improvement: update socialcard to match the python way (#687) EdwardCuiPeacock (2): Feature: add @Jinja and @Format casting (#704) Combo converter doc (#735) Eitan Mosenkis (1): Fix FlaskConfig.setdefault (#706) Enderson Menezes (Mr. Enderson) (2): Force PYTHONIOENCODING to utf-8 to fix #664 (#672) edit: move discussions to github tab (#682) Eugene Triguba (1): Fix custom prefix link in envvar documentation (#680) Gibran Herrera (1): Fix Issue 662 Lazy validation (#675) Jitendra Yejare (2): Load vault secrets from environment less stores or which are not written by dynaconf (#725) Use default value when settings is blank (#729) Pavel Alimpiev (1): Update docs link (#678) Ugo Benassayag (1): Added validate_only_current_env to validator (issue #734) (#736) Waylon Walker (1): Docs Fix Spelling (#696) dependabot[bot] (3): Bump django from 2.1.5 to 2.2.26 in /example/django_pytest_pure (#711) Bump mkdocs from 1.1.2 to 1.2.3 (#715) Bump django from 2.2.26 to 2.2.27 in /example/django_pytest_pure (#717) github-actions[bot] (2): [automated] Update Contributors File (#691) [automated] Update Contributors File (#732) lowercase00 (1): Makes Django/Flask kwargs case insensitive (#721)
Describe the bug
dynaconf init -f yaml
results in aUnicodeEncodeError
To Reproduce
Steps to reproduce the behavior:
git clone -b dynaconf https://github.com/ebenh/django-flex-user.git
py -m pipenv install --dev
py -m pipenv shell
export DJANGO_SETTINGS_MODULE=test_project.settings
dynaconf init -f yaml
Error Message
The text was updated successfully, but these errors were encountered: