decryptus / json-dotenv Goto Github PK
View Code? Open in Web Editor NEWManipulate and extract envfiles in json format.
License: GNU General Public License v3.0
Manipulate and extract envfiles in json format.
License: GNU General Public License v3.0
I use on Windows and get the error when run it
Command & error:
json-dotenv list -f private/.env
ERROR:2023-04-21 20:45:04: stat: path should be string, bytes, os.PathLike or integer, not StringIO
Traceback (most recent call last):
File "venv\Scripts\json-dotenv.py", line 462, in main
getattr(JsonDotEnv(options), "do_%s" % options.command)()
File "venv\Scripts\json-dotenv.py", line 337, in do_list
dotenv.dotenv_values(self.fcontent)))
File "venv\lib\site-packages\dotenv\main.py", line 375, in dotenv_values
return DotEnv(
File "venv\lib\site-packages\dotenv\main.py", line 75, in dict
self._dict = OrderedDict(resolve_variables(raw_values, override=self.override))
File "venv\lib\site-packages\dotenv\main.py", line 233, in resolve_variables
for (name, value) in values:
File "venv\lib\site-packages\dotenv\main.py", line 82, in parse
with self._get_stream() as stream:
File "C:\Program Files\Python39\lib\contextlib.py", line 117, in __enter__
return next(self.gen)
File "venv\lib\site-packages\dotenv\main.py", line 54, in _get_stream
if self.dotenv_path and os.path.isfile(self.dotenv_path):
File "C:\Program Files\Python39\lib\genericpath.py", line 30, in isfile
st = os.stat(path)
TypeError: stat: path should be string, bytes, os.PathLike or integer, not StringIO
I could fix the problem by adding stream argument to dotenv.dotenv_values execution like I read in a doc:
load_dotenv and dotenv_values accept [streams](https://docs.python.org/3/library/io.html) via their stream argument. It is thus possible to load the variables from sources other than the filesystem (e.g. the network).
from io import StringIO
from dotenv import load_dotenv
config = StringIO("USER=foo\[email protected]")
load_dotenv(stream=config)
Windows 10
Python 3.9.2
json-dotenv 0.0.28
python-dotenv 1.0.0
$ pip install json-dotenv
Collecting json-dotenv
Could not find a version that satisfies the requirement json-dotenv (from versions: )
No matching distribution found for json-dotenv
$ pip --version
pip 19.0.3 from /usr/lib/python3.7/site-packages/pip (python 3.7)
python 3.8
MacOS
the new line character is being added to the end of each value extracted from the env file
.env
ENV=dev
output
{"ENV": "dev\n"}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.