-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Default encoding for .env files #1963
Comments
Actually, now that I've removed the cyrillic symbols, I'm getting an |
@feakuru Yes, this should not happen. Post the traceback and I’ll work on it. Regarding the env file, what encoding do you expect it to be decoded with? UTF-8? (And for your question, it does not know what the file is encoded in, so it simply uses the system default, i.e. the code page encoding on Windows.) |
What about using io.open or whatever? |
Dotenv already uses |
@uranusjr so are we good to close this? |
@techalchemy Urrgh, I never got to work on this in the end… This is still not fixed, sorry. |
meet same bug with utf-8 encoded .env file on windows this is a bug of Their solution is that they will add a arguments |
Pull request is welcomed. Don’t wait for people; take on it yourself if you already know what to do :) |
@uranusjr I do want to start a pull request, but theskumar/python-dotenv#161 is not merged yet. Unless I can merge it into vendor before python-dotenv merge this pr. |
cc @techalchemy to maybe revisit this when we’re about to release the next version. |
I believe this was resolved. |
I had some Russian symbols in my
.env
file while launchingpipenv shell
from Windows 10 and got the following result:If it helps, here's the help output
$ python -m pipenv.help output
Pipenv version:
'11.10.0'
Pipenv location:
'C:\\Program Files (x86)\\Python36-32\\lib\\site-packages\\pipenv'
Python location:
'C:\\Program Files (x86)\\Python36-32\\python.exe'
Other Python installations in
PATH
:3.6
:C:\Program Files (x86)\Python36-32\python.exe
3.6.4
:C:\Program Files (x86)\Python36-32\python.exe
3.6.4
:C:\Windows\py.exe
PEP 508 Information:
System environment variables:
ACLOCAL_PATH
ALLUSERSPROFILE
APPDATA
COMMONPROGRAMFILES
COMPUTERNAME
COMSPEC
CONFIG_SITE
COMMONPROGRAMFILES(X86)
COMMONPROGRAMW6432
DISPLAY
EXEPATH
FPS_BROWSER_APP_PROFILE_STRING
FPS_BROWSER_USER_PROFILE_STRING
FSHARPINSTALLDIR
HOME
HOMEDRIVE
HOMEPATH
HOSTNAME
INFOPATH
LANG
LEIN_JAVA_CMD
LOCALAPPDATA
LOGONSERVER
MANPATH
MINGW_CHOST
MINGW_PACKAGE_PREFIX
MINGW_PREFIX
MSYSTEM
MSYSTEM_CARCH
MSYSTEM_CHOST
MSYSTEM_PREFIX
NUMBER_OF_PROCESSORS
ORIGINAL_PATH
ORIGINAL_TEMP
ORIGINAL_TMP
OS
ONEDRIVE
PATH
PATHEXT
PKG_CONFIG_PATH
PLINK_PROTOCOL
PROCESSOR_ARCHITECTURE
PROCESSOR_ARCHITEW6432
PROCESSOR_IDENTIFIER
PROCESSOR_LEVEL
PROCESSOR_REVISION
PROGRAMFILES
PS1
PSMODULEPATH
PUBLIC
PWD
PROGRAMDATA
PROGRAMFILES(X86)
PROGRAMW6432
SESSIONNAME
SHELL
SHLVL
SSH_ASKPASS
SYSTEMDRIVE
SYSTEMROOT
TEMP
TERM
TMP
TMPDIR
USERDOMAIN
USERDOMAIN_ROAMINGPROFILE
USERNAME
USERPROFILE
WINDIR
_
PYTHONDONTWRITEBYTECODE
PIP_PYTHON_PATH
PYTHONUNBUFFERED
Pipenv▒specific environment variables:
Debug▒specific environment variables:
PATH
:C:\Users\feana\bin;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\local\bin;C:\Program Files\Git\usr\bin;C:\Program Files\Git\usr\bin;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\bin;C:\Users\feana\bin;C:\Program Files\Docker\Docker\Resources\bin;C:\ProgramData\Oracle\Java\javapath;C:\Program Files (x86)\Python36-32\Scripts;C:\Program Files (x86)\Python36-32;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\Program Files\dotnet;C:\Program Files\Microsoft SQL Server\130\Tools\Binn;C:\Program Files\Git\cmd;C:\Users\feana\AppData\Local\Microsoft\WindowsApps;C:\Program Files\Microsoft VS Code\bin;C:\Users\feana\.lein\bin;C:\Program Files\Git\usr\bin\vendor_perl;C:\Program Files\Git\usr\bin\core_perl
SHELL
:C:\Program Files\Git\usr\bin\bash.exe
LANG
:en_US.UTF-8
PWD
:C:/Users/feana
Expected result
Correct .env file parsing.
Actual result
Somehow, it thinks the file is encoded in CP1252. Why?..
Steps to replicate
.env
pipenv shell
The text was updated successfully, but these errors were encountered: