From 5e5b3004f3863891ef463612c44e0bbff923fc22 Mon Sep 17 00:00:00 2001 From: Oliver Olsen <103891157+oliversen@users.noreply.github.com> Date: Thu, 9 May 2024 19:56:47 +0300 Subject: [PATCH] Fix wrong type annotations --- src/dotenv/main.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/dotenv/main.py b/src/dotenv/main.py index 052de054..ee604e56 100644 --- a/src/dotenv/main.py +++ b/src/dotenv/main.py @@ -35,14 +35,14 @@ def with_warn_for_invalid_lines(mappings: Iterator[Binding]) -> Iterator[Binding class DotEnv: def __init__( self, - dotenv_path: Optional[StrPath], + dotenv_path: StrPath, stream: Optional[IO[str]] = None, verbose: bool = False, encoding: Optional[str] = None, interpolate: bool = True, override: bool = True, ) -> None: - self.dotenv_path: Optional[StrPath] = dotenv_path + self.dotenv_path: StrPath = dotenv_path self.stream: Optional[IO[str]] = stream self._dict: Optional[Dict[str, Optional[str]]] = None self.verbose: bool = verbose @@ -130,7 +130,7 @@ def get_key( @contextmanager def rewrite( path: StrPath, - encoding: Optional[str], + encoding: str, ) -> Iterator[Tuple[IO[str], IO[str]]]: pathlib.Path(path).touch()