MCPcopy Index your code
hub / github.com/theskumar/python-dotenv / _get_stream

Method _get_stream

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

Source from the content-addressed store, hash-verified

59
60 @contextmanager
61 def _get_stream(self) -> Iterator[IO[str]]:
62 if self.dotenv_path and _is_file_or_fifo(self.dotenv_path):
63 with open(self.dotenv_path, encoding=self.encoding) as stream:
64 yield stream
65 elif self.stream is not None:
66 yield self.stream
67 else:
68 if self.verbose:
69 logger.info(
70 "python-dotenv could not find configuration file %s.",
71 self.dotenv_path or ".env",
72 )
73 yield io.StringIO("")
74
75 def dict(self) -> Dict[str, Optional[str]]:
76 """Return dotenv as dict"""

Callers 1

parseMethod · 0.95

Calls 1

_is_file_or_fifoFunction · 0.85

Tested by

no test coverage detected