From c0cd75832127e2840c76f647cf6d8353488dc729 Mon Sep 17 00:00:00 2001 From: Abhishek Date: Wed, 11 Nov 2026 21:21:53 -0600 Subject: [PATCH] Correct optional polib file and message context attributes --- stubs/polib/polib.pyi | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/stubs/polib/polib.pyi b/stubs/polib/polib.pyi index a41fe1dea93a..63279e7c3722 100644 --- a/stubs/polib/polib.pyi +++ b/stubs/polib/polib.pyi @@ -1,3 +1,4 @@ +from _typeshed import StrOrBytesPath from collections.abc import Callable from pathlib import Path from typing import IO, Any, Generic, Literal, SupportsIndex, TypeVar, overload @@ -26,7 +27,7 @@ def escape(st: str) -> str: ... def unescape(st: str) -> str: ... class _BaseFile(list[_TB]): - fpath: str + fpath: StrOrBytesPath | None wrapwidth: int encoding: str check_for_duplicates: bool @@ -42,7 +43,7 @@ class _BaseFile(list[_TB]): def metadata_as_entry(self) -> POEntry: ... def save(self, fpath: str | None = ..., repr_method: str = ..., newline: str | None = ...) -> None: ... def find( - self, st: str, by: str = ..., include_obsolete_entries: bool = ..., msgctxt: str | Literal[False] = ... + self, st: str, by: str = ..., include_obsolete_entries: bool = ..., msgctxt: str | Literal[False] | None = ... ) -> _TB | None: ... def ordered_metadata(self) -> list[tuple[str, str]]: ... def to_binary(self) -> bytes: ... @@ -76,7 +77,7 @@ class _BaseEntry: msgstr: str msgid_plural: str msgstr_plural: dict[int, str] - msgctxt: str + msgctxt: str | None obsolete: bool encoding: str def __init__(self, *args: Any, **kwargs: Any) -> None: ...