MCPcopy Create free account
hub / github.com/theskumar/python-dotenv / _get_stream

Method _get_stream

src/dotenv/main.py:53–65  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

51
52 @contextmanager
53 def _get_stream(self) -> Iterator[IO[str]]:
54 if self.dotenv_path and os.path.isfile(self.dotenv_path):
55 with open(self.dotenv_path, encoding=self.encoding) as stream:
56 yield stream
57 elif self.stream is not None:
58 yield self.stream
59 else:
60 if self.verbose:
61 logger.info(
62 "Python-dotenv could not find configuration file %s.",
63 self.dotenv_path or '.env',
64 )
65 yield io.StringIO('')
66
67 def dict(self) -> Dict[str, Optional[str]]:
68 """Return dotenv as dict"""

Callers 1

parseMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected