Sanic

Latest version: v23.12.1

Safety actively analyzes 629959 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 3 of 12

22.3.1

Not secure
What's Changed
* Add fall back for Windows even loop fetching by ahopkins in https://github.com/sanic-org/sanic/pull/2421


**Full Changelog**: https://github.com/sanic-org/sanic/compare/v22.3.0...v22.3.1

22.3.0

Not secure
Features
- [2347](https://github.com/sanic-org/sanic/pull/2347) API for multi-application server
- 🚨 *BREAKING CHANGE*: The old `sanic.worker.GunicornWorker` has been **removed**. To run Sanic with `gunicorn`, you should use it thru `uvicorn` [as described in their docs](https://www.uvicorn.org/#running-with-gunicorn).
- 🧁 *SIDE EFFECT*: Named background tasks are now supported, even in Python 3.7
- [2357](https://github.com/sanic-org/sanic/pull/2357) Parse `Authorization` header as `Request.credentials`
- [2361](https://github.com/sanic-org/sanic/pull/2361) Add config option to skip `Touchup` step in application startup
- [2372](https://github.com/sanic-org/sanic/pull/2372) Updates to CLI help messaging
- [2382](https://github.com/sanic-org/sanic/pull/2382) Downgrade warnings to backwater debug messages
- [2396](https://github.com/sanic-org/sanic/pull/2396) Allow for `multidict` v0.6
- [2401](https://github.com/sanic-org/sanic/pull/2401) Upgrade CLI catching for alternative application run types
- [2402](https://github.com/sanic-org/sanic/pull/2402) Conditionally inject CLI arguments into factory
- [2413](https://github.com/sanic-org/sanic/pull/2413) Add new start and stop event listeners to reloader process
- [2414](https://github.com/sanic-org/sanic/pull/2414) Remove loop as required listener arg
- [2415](https://github.com/sanic-org/sanic/pull/2415) Better exception for bad URL parsing
- [sanic-routing47](https://github.com/sanic-org/sanic-routing/pull/47) Add a new extention parameter type: `<file:ext>`, `<file:ext=jpg>`, `<file:ext=jpg|png|gif|svg>`, `<file=int:ext>`, `<file=int:ext=jpg|png|gif|svg>`, `<file=float:ext=tar.gz>`
- 👶 *BETA FEATURE*: This feature will not work with `path` type matching, and is being released as a beta feature only.
- [sanic-routing57](https://github.com/sanic-org/sanic-routing/pull/57) Change `register_pattern` to accept a `str` or `Pattern`
- [sanic-routing58](https://github.com/sanic-org/sanic-routing/pull/58) Default matching on non-empty strings only, and new `strorempty` pattern type
- 🚨 *BREAKING CHANGE*: Previously a route with a dynamic string parameter (`/<foo>` or `/<foo:str>`) would match on any string, including empty strings. It will now **only** match a non-empty string. To retain the old behavior, you should use the new parameter type: `/<foo:strorempty>`.

Bugfixes
- [2373](https://github.com/sanic-org/sanic/pull/2373) Remove `error_logger` on websockets
- [2381](https://github.com/sanic-org/sanic/pull/2381) Fix newly assigned `None` in task registry
- [sanic-routing52](https://github.com/sanic-org/sanic-routing/pull/52) Add type casting to regex route matching
- [sanic-routing60](https://github.com/sanic-org/sanic-routing/pull/60) Add requirements check on regex routes (this resolves, for example, multiple static directories with differing `host` values)

Deprecations and Removals
- [2362](https://github.com/sanic-org/sanic/pull/2362) 22.3 Deprecations and changes
1. `debug=True` and `--debug` do _NOT_ automatically run `auto_reload`
2. Default error render is with plain text (browsers still get HTML by default because `auto` looks at headers)
3. `config` is required for `ErrorHandler.finalize`
4. `ErrorHandler.lookup` requires two positional args
5. Unused websocket protocol args removed
- [2344](https://github.com/sanic-org/sanic/pull/2344) Deprecate loading of lowercase environment variables

Developer infrastructure
- [2363](https://github.com/sanic-org/sanic/pull/2363) Revert code coverage back to Codecov
- [2405](https://github.com/sanic-org/sanic/pull/2405) Upgrade tests for `sanic-routing` changes
- [sanic-testing35](https://github.com/sanic-org/sanic-testing/pull/35) Allow for httpx v0.22

Improved Documentation
- [2350](https://github.com/sanic-org/sanic/pull/2350) Fix link in README for ASGI
- [2398](https://github.com/sanic-org/sanic/pull/2398) Document middleware on_request and on_response
- [2409](https://github.com/sanic-org/sanic/pull/2409) Add missing documentation for `Request.respond`

Miscellaneous
- [2376](https://github.com/sanic-org/sanic/pull/2376) Fix typing for `ListenerMixin.listener`
- [2383](https://github.com/sanic-org/sanic/pull/2383) Clear deprecation warning in `asyncio.wait`
- [2387](https://github.com/sanic-org/sanic/pull/2387) Cleanup `__slots__` implementations
- [2390](https://github.com/sanic-org/sanic/pull/2390) Clear deprecation warning in `asyncio.get_event_loop`

21.12.2

Resolves 2477 and 2478
See also 2495 and https://github.com/sanic-org/sanic/security/advisories/GHSA-8cw9-5hmv-77w6

**Full Changelog**: https://github.com/sanic-org/sanic/compare/v21.12.1...v21.12.2

21.12.1

Not secure
- [2349](https://github.com/sanic-org/sanic/pull/2349) Only display MOTD on startup
- [2354](https://github.com/sanic-org/sanic/pull/2354) Add config.update support for all config values
- [2355](https://github.com/sanic-org/sanic/pull/2355) Ignore name argument in Python 3.7

21.12.0

Not secure
Features
- [2260](https://github.com/sanic-org/sanic/pull/2260) Allow early Blueprint registrations to still apply later added objects
- [2262](https://github.com/sanic-org/sanic/pull/2262) Noisy exceptions - force logging of all exceptions
- [2264](https://github.com/sanic-org/sanic/pull/2264) Optional `uvloop` by configuration
- [2270](https://github.com/sanic-org/sanic/pull/2270) Vhost support using multiple TLS certificates
- [2277](https://github.com/sanic-org/sanic/pull/2277) Change signal routing for increased consistency
- *BREAKING CHANGE*: If you were manually routing signals there is a breaking change. The signal router's `get` is no longer 100% determinative. There is now an additional step to loop thru the returned signals for proper matching on the requirements. If signals are being dispatched using `app.dispatch` or `bp.dispatch`, there is no change.
- [2290](https://github.com/sanic-org/sanic/pull/2290) Add contextual exceptions
- [2291](https://github.com/sanic-org/sanic/pull/2291) Increase join concat performance
- [2295](https://github.com/sanic-org/sanic/pull/2295), [#2316](https://github.com/sanic-org/sanic/pull/2316), [#2331](https://github.com/sanic-org/sanic/pull/2331) Restructure of CLI and application state with new displays and more command parity with `app.run`
- [2302](https://github.com/sanic-org/sanic/pull/2302) Add route context at definition time
- [2304](https://github.com/sanic-org/sanic/pull/2304) Named tasks and new API for managing background tasks
- [2307](https://github.com/sanic-org/sanic/pull/2307) On app auto-reload, provide insight of changed files
- [2308](https://github.com/sanic-org/sanic/pull/2308) Auto extend application with [Sanic Extensions](https://sanicframework.org/en/plugins/sanic-ext/getting-started.html) if it is installed, and provide first class support for accessing the extensions
- [2309](https://github.com/sanic-org/sanic/pull/2309) Builtin signals changed to `Enum`
- [2313](https://github.com/sanic-org/sanic/pull/2313) Support additional config implementation use case
- [2321](https://github.com/sanic-org/sanic/pull/2321) Refactor environment variable hydration logic
- [2327](https://github.com/sanic-org/sanic/pull/2327) Prevent sending multiple or mixed responses on a single request
- [2330](https://github.com/sanic-org/sanic/pull/2330) Custom type casting on environment variables
- [2332](https://github.com/sanic-org/sanic/pull/2332) Make all deprecation notices consistent
- [2335](https://github.com/sanic-org/sanic/pull/2335) Allow underscore to start instance names

Bugfixes
- [2273](https://github.com/sanic-org/sanic/pull/2273) Replace assignation by typing for `websocket_handshake`
- [2285](https://github.com/sanic-org/sanic/pull/2285) Fix IPv6 display in startup logs
- [2299](https://github.com/sanic-org/sanic/pull/2299) Dispatch `http.lifecyle.response` from exception handler

Deprecations and Removals
- [2306](https://github.com/sanic-org/sanic/pull/2306) Removal of deprecated items
- `Sanic` and `Blueprint` may no longer have arbitrary properties attached to them
- `Sanic` and `Blueprint` forced to have compliant names
- alphanumeric + `_` + `-`
- must start with letter or `_`
- `load_env` keyword argument of `Sanic`
- `sanic.exceptions.abort`
- `sanic.views.CompositionView`
- `sanic.response.StreamingHTTPResponse`
- *NOTE:* the `stream()` response method (where you pass a callable streaming function) has been deprecated and will be removed in v22.6. You should upgrade all streaming responses to the new style: https://sanicframework.org/en/guide/advanced/streaming.html#response-streaming
- [2320](https://github.com/sanic-org/sanic/pull/2320) Remove app instance from Config for error handler setting

Developer infrastructure
- [2251](https://github.com/sanic-org/sanic/pull/2251) Change dev install command
- [2286](https://github.com/sanic-org/sanic/pull/2286) Change codeclimate complexity threshold from 5 to 10
- [2287](https://github.com/sanic-org/sanic/pull/2287) Update host test function names so they are not overwritten
- [2292](https://github.com/sanic-org/sanic/pull/2292) Fail CI on error
- [2311](https://github.com/sanic-org/sanic/pull/2311), [#2324](https://github.com/sanic-org/sanic/pull/2324) Do not run tests for draft PRs
- [2336](https://github.com/sanic-org/sanic/pull/2336) Remove paths from coverage checks
- [2338](https://github.com/sanic-org/sanic/pull/2338) Cleanup ports on tests

Improved Documentation
- [2269](https://github.com/sanic-org/sanic/pull/2269), [#2329](https://github.com/sanic-org/sanic/pull/2329), [#2333](https://github.com/sanic-org/sanic/pull/2333) Cleanup typos and fix language

Miscellaneous
- [2257](https://github.com/sanic-org/sanic/pull/2257), [#2294](https://github.com/sanic-org/sanic/pull/2294), [#2341](https://github.com/sanic-org/sanic/pull/2341) Add Python 3.10 support
- [2279](https://github.com/sanic-org/sanic/pull/2279), [#2317](https://github.com/sanic-org/sanic/pull/2317), [#2322](https://github.com/sanic-org/sanic/pull/2322) Add/correct missing type annotations
- [2305](https://github.com/sanic-org/sanic/pull/2305) Fix examples to use modern implementations

21.9.3

Not secure
_Rerelease of v21.9.2 with some cleanup_

Page 3 of 12

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.