(self)
| 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""" |