diff --git a/CHANGES.rst b/CHANGES.rst index 478a20ed0..455cc2c42 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -24,6 +24,16 @@ Version 2.2.0 functions from wsgi.py. :pr:`2415` +Version 2.1.3 +------------- + +Unreleased + +- Add ``os.PathLike`` as a supported type for + ``werkzeug.datastructures.FileStorage`` in the typing information + file. It was already supported by the code. :pr:`2418` + + Version 2.1.2 ------------- diff --git a/docs/datastructures.rst b/docs/datastructures.rst index 10e3715e2..01432f413 100644 --- a/docs/datastructures.rst +++ b/docs/datastructures.rst @@ -122,7 +122,8 @@ Others .. attribute:: filename - The filename of the file on the client. + The filename of the file on the client. Can be a ``str``, or an + instance of ``os.PathLike``. .. attribute:: name diff --git a/src/werkzeug/datastructures.pyi b/src/werkzeug/datastructures.pyi index 6050f3508..7bf729789 100644 --- a/src/werkzeug/datastructures.pyi +++ b/src/werkzeug/datastructures.pyi @@ -896,7 +896,7 @@ class FileStorage: def __init__( self, stream: Optional[IO[bytes]] = None, - filename: Optional[str] = None, + filename: Union[str, PathLike, None] = None, name: Optional[str] = None, content_type: Optional[str] = None, content_length: Optional[int] = None,