Skip to content

Upgrading starlette 0.23 to 0.24

Breaking0.23.1 → 0.24.0Breaking1New6Changed2Fixed1

BreakingUpgrade verdict

1 breaking change.

  • Creating an UploadFile now requires passing a file.
1 item needs code or config changes
Breaking1
Makes the file argument required on UploadFile.
UploadFilefile

Generated by DepDelta from published Python source. Not mixed with prose notes.

  • removed: property Starlette.debug -> bool
  • changed: constructor Config(env_file: typing.Optional[typing.Union[str, Path]]=…, environ: typing.Mapping[str, str]=…) -> None → constructor Config(env_file: typing.Optional[typing.Union[str, Path]]=…, environ: typing.Mapping[str, str]=…, env_prefix: str=…) -> None
  • removed: field UploadFile.file: typing.BinaryIO
  • removed: field UploadFile.headers: Headers
  • removed: field UploadFile.spool_max_size
  • changed: constructor UploadFile(filename: str, file: typing.Optional[typing.BinaryIO]=…, content_type: str=…, *, headers: typing.Optional[Headers]=…) -> None → constructor UploadFile(file: typing.BinaryIO, *, size: typing.Optional[int]=…, filename: typing.Optional[str]=…, headers: typing.Optional[Headers]=…) -> None
  • added: property UploadFile.content_type -> typing.Optional[str]
  • added: field MultiPartParser.max_file_size
  • changed: async method Request.form() -> FormData → method Request.form() -> AwaitableOrContextManager[FormData]
  • changed: method Response.set_cookie(key: str, value: str=…, max_age: typing.Optional[int]=…, expires: typing.Optional[int]=…, path: str=…, domain: typing.Optional[str]=…, secure: bool=…, httponly: bool=…, samesite: typing.Optional[Literal['lax', 'strict', 'none']]=…) -> None → method Response.set_cookie(key: str, value: str=…, max_age: typing.Optional[int]=…, expires: typing.Optional[typing.Union[datetime, str, int]]=…, path: str=…, domain: typing.Optional[str]=…, secure: bool=…, httponly: bool=…, samesite: typing.Optional[Literal['lax', 'strict', 'none']]=…) -> None
  • changed: constructor StaticFiles(*, directory: typing.Optional[PathLike]=…, packages: typing.Optional[typing.List[typing.Union[str, typing.Tuple[str, str]]]]=…, html: bool=…, check_dir: bool=…) -> None → constructor StaticFiles(*, directory: typing.Optional[PathLike]=…, packages: typing.Optional[typing.List[typing.Union[str, typing.Tuple[str, str]]]]=…, html: bool=…, check_dir: bool=…, follow_symlink: bool=…) -> None
  • changed: constructor Jinja2Templates(directory: typing.Union[str, PathLike], **env_options: typing.Any) -> None → constructor Jinja2Templates(directory: typing.Union[str, PathLike], context_processors: typing.Optional[typing.List[typing.Callable[[Request], typing.Dict[str, typing.Any]]]]=…, **env_options: typing.Any) -> None