Release 23.3 (#2723)

This commit is contained in:
Adam Hopkins 2023-03-26 22:54:28 +03:00 committed by GitHub
parent d680af3709
commit 6eaab2a7e5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 82 additions and 15 deletions

View File

@ -316,8 +316,6 @@ Version 21.3.0
Version 20.12.3 Version 20.12.3
--------------- ---------------
`Current LTS version`
**Bugfixes** **Bugfixes**
* *

View File

@ -1,6 +1,11 @@
📜 Changelog 📜 Changelog
============ ============
| 🔶 Current release
| 🔷 In support release
|
.. mdinclude:: ./releases/23/23.3.md
.. mdinclude:: ./releases/22/22.12.md .. mdinclude:: ./releases/22/22.12.md
.. mdinclude:: ./releases/22/22.9.md .. mdinclude:: ./releases/22/22.9.md
.. mdinclude:: ./releases/22/22.6.md .. mdinclude:: ./releases/22/22.6.md

View File

@ -1,4 +1,4 @@
## Version 22.12.0 🔶 ## Version 22.12.0 🔷
_Current version_ _Current version_

View File

@ -0,0 +1,53 @@
## Version 23.3.0 🔶
### Features
- [#2545](https://github.com/sanic-org/sanic/pull/2545) Standardize init of exceptions for more consistent control of HTTP responses using exceptions
- [#2606](https://github.com/sanic-org/sanic/pull/2606) Decode headers as UTF-8 also in ASGI
- [#2646](https://github.com/sanic-org/sanic/pull/2646) Separate ASGI request and lifespan callables
- [#2659](https://github.com/sanic-org/sanic/pull/2659) Use ``FALLBACK_ERROR_FORMAT`` for handlers that return ``empty()``
- [#2662](https://github.com/sanic-org/sanic/pull/2662) Add basic file browser (HTML page) and auto-index serving
- [#2667](https://github.com/sanic-org/sanic/pull/2667) Nicer traceback formatting (HTML page)
- [#2668](https://github.com/sanic-org/sanic/pull/2668) Smarter error page rendering format selection; more reliant upon header and "common sense" defaults
- [#2680](https://github.com/sanic-org/sanic/pull/2680) Check the status of socket before shutting down with ``SHUT_RDWR``
- [#2687](https://github.com/sanic-org/sanic/pull/2687) Refresh ``Request.accept`` functionality to be more performant and spec-compliant
- [#2696](https://github.com/sanic-org/sanic/pull/2696) Add header accessors as properties
```
Example-Field: Foo, Bar
Example-Field: Baz
```
```python
request.headers.example_field == "Foo, Bar,Baz"
```
- [#2700](https://github.com/sanic-org/sanic/pull/2700) Simpler CLI targets
```sh
$ sanic path.to.module:app # global app instance
$ sanic path.to.module:create_app # factory pattern
$ sanic ./path/to/directory/ # simple serve
```
- [#2701](https://github.com/sanic-org/sanic/pull/2701) API to define a number of workers in managed processes
- [#2704](https://github.com/sanic-org/sanic/pull/2704) Add convenience for dynamic changes to routing
- [#2706](https://github.com/sanic-org/sanic/pull/2706) Add convenience methods for cookie creation and deletion
```python
response = text("...")
response.add_cookie("test", "It worked!", domain=".yummy-yummy-cookie.com")
```
- [#2707](https://github.com/sanic-org/sanic/pull/2707) Simplified ``parse_content_header`` escaping to be RFC-compliant and remove outdated FF hack
- [#2710](https://github.com/sanic-org/sanic/pull/2710) Stricter charset handling and escaping of request URLs
- [#2711](https://github.com/sanic-org/sanic/pull/2711) Consume body on ``DELETE`` by default
- [#2719](https://github.com/sanic-org/sanic/pull/2719) Allow ``password`` to be passed to TLS context
- [#2720](https://github.com/sanic-org/sanic/pull/2720) Skip middleware on ``RequestCancelled``
- [#2721](https://github.com/sanic-org/sanic/pull/2721) Change access logging format to ``%s``
- [#2722](https://github.com/sanic-org/sanic/pull/2722) Add ``CertLoader`` as application option for directly controlling ``SSLContext`` objects
- [#2725](https://github.com/sanic-org/sanic/pull/2725) Worker sync state tolerance on race condition
### Bugfixes
- [#2651](https://github.com/sanic-org/sanic/pull/2651) ASGI websocket to pass thru bytes as is
- [#2697](https://github.com/sanic-org/sanic/pull/2697) Fix comparison between datetime aware and naive in ``file`` when using ``If-Modified-Since``
### Deprecations and Removals
- [#2666](https://github.com/sanic-org/sanic/pull/2666) Remove deprecated ``__blueprintname__`` property
### Improved Documentation
- [#2712](https://github.com/sanic-org/sanic/pull/2712) Improved example using ``'https'`` to create the redirect

View File

@ -1 +1 @@
__version__ = "22.12.0" __version__ = "23.3.0"

View File

@ -1589,7 +1589,8 @@ class Sanic(StaticHandleMixin, BaseSanic, StartupMixin, metaclass=TouchUpMeta):
f"Duplicate route names detected: {names}. You should rename " f"Duplicate route names detected: {names}. You should rename "
"one or more of them explicitly by using the `name` param, " "one or more of them explicitly by using the `name` param, "
"or changing the implicit name derived from the class and " "or changing the implicit name derived from the class and "
"function name. For more details, please see ___." "function name. For more details, please see "
"https://sanic.dev/en/guide/release-notes/v23.3.html#duplicated-route-names-are-no-longer-allowed" # noqa
) )
raise ServerError(message) raise ServerError(message)

View File

@ -81,7 +81,8 @@ class CookieRequestParameters(RequestParameters):
"accessing a cookie value like this will return a list of values. " "accessing a cookie value like this will return a list of values. "
"To avoid this behavior and continue accessing a single value, " "To avoid this behavior and continue accessing a single value, "
f"please upgrade from request.cookies['{key}'] to " f"please upgrade from request.cookies['{key}'] to "
f"request.cookies.get('{key}'). See more details: ___.", f"request.cookies.get('{key}'). See more details: "
"https://sanic.dev/en/guide/release-notes/v23.3.html#request-cookies", # noqa
24.3, 24.3,
) )
try: try:

View File

@ -70,7 +70,8 @@ class CookieJar(dict):
deprecation( deprecation(
"Setting cookie values using the dict pattern has been " "Setting cookie values using the dict pattern has been "
"deprecated. You should instead use the cookies.add_cookie " "deprecated. You should instead use the cookies.add_cookie "
"method. To learn more, please see: ___.", "method. To learn more, please see: "
"https://sanic.dev/en/guide/release-notes/v23.3.html#response-cookies", # noqa
0, 0,
) )
if key not in self: if key not in self:
@ -82,7 +83,8 @@ class CookieJar(dict):
deprecation( deprecation(
"Deleting cookie values using the dict pattern has been " "Deleting cookie values using the dict pattern has been "
"deprecated. You should instead use the cookies.delete_cookie " "deprecated. You should instead use the cookies.delete_cookie "
"method. To learn more, please see: ___.", "method. To learn more, please see: "
"https://sanic.dev/en/guide/release-notes/v23.3.html#response-cookies", # noqa
0, 0,
) )
if key in self: if key in self:
@ -96,7 +98,8 @@ class CookieJar(dict):
deprecation( deprecation(
"Accessing cookies from the CookieJar by dict key is deprecated. " "Accessing cookies from the CookieJar by dict key is deprecated. "
"You should instead use the cookies.get_cookie method. " "You should instead use the cookies.get_cookie method. "
"To learn more, please see: ___.", "To learn more, please see: "
"https://sanic.dev/en/guide/release-notes/v23.3.html#response-cookies", # noqa
0, 0,
) )
return super().__getitem__(key) return super().__getitem__(key)
@ -104,7 +107,8 @@ class CookieJar(dict):
def __iter__(self): # no cov def __iter__(self): # no cov
deprecation( deprecation(
"Iterating over the CookieJar has been deprecated and will be " "Iterating over the CookieJar has been deprecated and will be "
"removed in v24.3. To learn more, please see: ___.", "removed in v24.3. To learn more, please see: "
"https://sanic.dev/en/guide/release-notes/v23.3.html#response-cookies", # noqa
24.3, 24.3,
) )
return super().__iter__() return super().__iter__()
@ -112,7 +116,8 @@ class CookieJar(dict):
def keys(self): # no cov def keys(self): # no cov
deprecation( deprecation(
"Accessing CookieJar.keys() has been deprecated and will be " "Accessing CookieJar.keys() has been deprecated and will be "
"removed in v24.3. To learn more, please see: ___.", "removed in v24.3. To learn more, please see: "
"https://sanic.dev/en/guide/release-notes/v23.3.html#response-cookies", # noqa
24.3, 24.3,
) )
return super().keys() return super().keys()
@ -120,7 +125,8 @@ class CookieJar(dict):
def values(self): # no cov def values(self): # no cov
deprecation( deprecation(
"Accessing CookieJar.values() has been deprecated and will be " "Accessing CookieJar.values() has been deprecated and will be "
"removed in v24.3. To learn more, please see: ___.", "removed in v24.3. To learn more, please see: "
"https://sanic.dev/en/guide/release-notes/v23.3.html#response-cookies", # noqa
24.3, 24.3,
) )
return super().values() return super().values()
@ -128,7 +134,8 @@ class CookieJar(dict):
def items(self): # no cov def items(self): # no cov
deprecation( deprecation(
"Accessing CookieJar.items() has been deprecated and will be " "Accessing CookieJar.items() has been deprecated and will be "
"removed in v24.3. To learn more, please see: ___.", "removed in v24.3. To learn more, please see: "
"https://sanic.dev/en/guide/release-notes/v23.3.html#response-cookies", # noqa
24.3, 24.3,
) )
return super().items() return super().items()
@ -137,7 +144,8 @@ class CookieJar(dict):
deprecation( deprecation(
"Accessing cookies from the CookieJar using get is deprecated " "Accessing cookies from the CookieJar using get is deprecated "
"and will be removed in v24.3. You should instead use the " "and will be removed in v24.3. You should instead use the "
"cookies.get_cookie method. To learn more, please see: ___.", "cookies.get_cookie method. To learn more, please see: "
"https://sanic.dev/en/guide/release-notes/v23.3.html#response-cookies", # noqa
24.3, 24.3,
) )
return super().get(*args, **kwargs) return super().get(*args, **kwargs)
@ -145,7 +153,8 @@ class CookieJar(dict):
def pop(self, key, *args, **kwargs): # no cov def pop(self, key, *args, **kwargs): # no cov
deprecation( deprecation(
"Using CookieJar.pop() has been deprecated and will be " "Using CookieJar.pop() has been deprecated and will be "
"removed in v24.3. To learn more, please see: ___.", "removed in v24.3. To learn more, please see: "
"https://sanic.dev/en/guide/release-notes/v23.3.html#response-cookies", # noqa
24.3, 24.3,
) )
self.delete(key) self.delete(key)