Sanic

Latest version: v23.12.1

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

Scan your dependencies

Page 1 of 12

23.12.1

What's Changed
* Fix broken multiplexer manage by ahopkins in https://github.com/sanic-org/sanic/pull/2895
* Do not strip entity-headers with HTTP status 304 or 412 by Tronic in https://github.com/sanic-org/sanic/pull/2824


**Full Changelog**: https://github.com/sanic-org/sanic/compare/v23.12.0...v23.12.1

23.12

New Contributors
* tjni made their first contribution in https://github.com/sanic-org/sanic/pull/2801
* freddiewanah made their first contribution in https://github.com/sanic-org/sanic/pull/2796
* MichaelHinrichs made their first contribution in https://github.com/sanic-org/sanic/pull/2855
* iAndriy made their first contribution in https://github.com/sanic-org/sanic/pull/2864
* talljosh made their first contribution in https://github.com/sanic-org/sanic/pull/2827

**Full Changelog**: https://github.com/sanic-org/sanic/compare/v23.6.0...v23.12.0

23.12.0

_Current version_

Features
- [2775](https://github.com/sanic-org/sanic/pull/2775) Start and restart arbitrary processes
- [2811](https://github.com/sanic-org/sanic/pull/2811) Cleaner process management in shutdown
- [2812](https://github.com/sanic-org/sanic/pull/2812) Suppress task cancel traceback on open websocket
- [2822](https://github.com/sanic-org/sanic/pull/2822) Listener and signal prioritization
- [2831](https://github.com/sanic-org/sanic/pull/2831) Reduce memory consumption
- [2837](https://github.com/sanic-org/sanic/pull/2837) Accept bare cookies
- [2841](https://github.com/sanic-org/sanic/pull/2841) Add `websocket.handler.<before/after/exception>` signals
- [2805](https://github.com/sanic-org/sanic/pull/2805) Add changed files to reload trigger listeners
- [2813](https://github.com/sanic-org/sanic/pull/2813) Allow for simple signals
- [2827](https://github.com/sanic-org/sanic/pull/2827) Improve functionality and consistency of `Sanic.event()`
- [2851](https://github.com/sanic-org/sanic/pull/2851) Allow range requests for a single byte
- [2854](https://github.com/sanic-org/sanic/pull/2854) Better `Request.scheme` for websocket requests
- [2858](https://github.com/sanic-org/sanic/pull/2858) Convert Sanic `Request` to a Websockets `Request` for handshake
- [2859](https://github.com/sanic-org/sanic/pull/2859) Add a REPL to the `sanic` CLI
- [2870](https://github.com/sanic-org/sanic/pull/2870) Add Python 3.12 support
- [2875](https://github.com/sanic-org/sanic/pull/2875) Better exception on multiprocessing context conflicts

Bugfixes
- [2803](https://github.com/sanic-org/sanic/pull/2803) Fix MOTD display for extra data

Deprecations and Removals

Developer infrastructure
- [2796](https://github.com/sanic-org/sanic/pull/2796) Refactor unit test cases
- [2801](https://github.com/sanic-org/sanic/pull/2801) Fix `test_fast` when there is only one CPU
- [2807](https://github.com/sanic-org/sanic/pull/2807) Add constraint for autodocsum (lint issue in old package version)
- [2808](https://github.com/sanic-org/sanic/pull/2808) Refactor GitHub Actions
- [2814](https://github.com/sanic-org/sanic/pull/2814) Run CI pipeline on git push
- [2846](https://github.com/sanic-org/sanic/pull/2846) Drop old performance tests/benchmarks
- [2848](https://github.com/sanic-org/sanic/pull/2848) Makefile cleanup
- [2865](https://github.com/sanic-org/sanic/pull/2865)
[2869](https://github.com/sanic-org/sanic/pull/2869)
[2872](https://github.com/sanic-org/sanic/pull/2872)
[2879](https://github.com/sanic-org/sanic/pull/2879)
Add ruff to toolchain
- [2866](https://github.com/sanic-org/sanic/pull/2866) Fix the alt svc test to run locally with explicit buffer nbytes
- [2877](https://github.com/sanic-org/sanic/pull/2877) Use Python's trusted publisher in deployments
- [2882](https://github.com/sanic-org/sanic/pull/2882) Introduce dynamic port fixture in targeted locations in the test suite

Improved Documentation
- [2781](https://github.com/sanic-org/sanic/pull/2781)
[2821](https://github.com/sanic-org/sanic/pull/2821)
[2861](https://github.com/sanic-org/sanic/pull/2861)
[2863](https://github.com/sanic-org/sanic/pull/2863)
Conversion of User Guide to the SHH (Sanic, html5tagger, HTMX) stack
- [2810](https://github.com/sanic-org/sanic/pull/2810) Update README
- [2855](https://github.com/sanic-org/sanic/pull/2855) Edit Discord badge
- [2864](https://github.com/sanic-org/sanic/pull/2864) Adjust documentation for using state properties within http/https redirection document


---

What's Changed
* Add constraint for autodocsumm by prryplatypus in https://github.com/sanic-org/sanic/pull/2807
* Update README by prryplatypus in https://github.com/sanic-org/sanic/pull/2810
* Refactor GitHub Actions by prryplatypus in https://github.com/sanic-org/sanic/pull/2808
* Suppress task cancel traceback by ahopkins in https://github.com/sanic-org/sanic/pull/2812
* Run tests on push as well by prryplatypus in https://github.com/sanic-org/sanic/pull/2814
* Conversion of User Guide to the SHH stack by ahopkins in https://github.com/sanic-org/sanic/pull/2781
* Fix test_fast when there's only one CPU by tjni in https://github.com/sanic-org/sanic/pull/2801
* Refactoring unit test cases by freddiewanah in https://github.com/sanic-org/sanic/pull/2796
* Accept bare cookies by Tronic in https://github.com/sanic-org/sanic/pull/2837
* Allow range requests for a single byte by Tronic in https://github.com/sanic-org/sanic/pull/2851
* Edit Discord badge. by MichaelHinrichs in https://github.com/sanic-org/sanic/pull/2855
* Makefile cleanup by ChihweiLHBird in https://github.com/sanic-org/sanic/pull/2848
* Drop old performance tests/benchmarks by sjsadowski in https://github.com/sanic-org/sanic/pull/2846
* Add websocket.handler.before/after/exception signals by Tronic in https://github.com/sanic-org/sanic/pull/2841
* Reducing memory consumption by gluhar2006 in https://github.com/sanic-org/sanic/pull/2831
* Improvements to documentation by ahopkins in https://github.com/sanic-org/sanic/pull/2821
* Add missing requirement by ahopkins in https://github.com/sanic-org/sanic/pull/2861
* Fix MOTD for extra data by ahopkins in https://github.com/sanic-org/sanic/pull/2803
* Style changes for mobile by ahopkins in https://github.com/sanic-org/sanic/pull/2863
* Add ruff to toolchain by ahopkins in https://github.com/sanic-org/sanic/pull/2865
* Allow for simple signals by ahopkins in https://github.com/sanic-org/sanic/pull/2813
* issue:2832 Adjust documentation for using state properties within http -> https redirects doc. by iAndriy in https://github.com/sanic-org/sanic/pull/2864
* Fix the alt svc test to run locally with explicit buffer nbytes by ahopkins in https://github.com/sanic-org/sanic/pull/2866
* Add changed files to reload trigger listener by ahopkins in https://github.com/sanic-org/sanic/pull/2805
* Introduce ruff execution on the examples and scripts folder 2867 by iAndriy in https://github.com/sanic-org/sanic/pull/2869
* Cleaner process management by ahopkins in https://github.com/sanic-org/sanic/pull/2811
* Improve functionality and consistency of Sanic.event() by talljosh in https://github.com/sanic-org/sanic/pull/2827
* Make request.scheme return ws/wss for WS even when http/https in SERVER_NAME or proxy headers by Tronic in https://github.com/sanic-org/sanic/pull/2854
* Add support for listener and signal prioritization by ahopkins in https://github.com/sanic-org/sanic/pull/2822
* Better exception on multiprocessing context conflicts by ahopkins in https://github.com/sanic-org/sanic/pull/2875
* Convert Sanic `Request` to WebSocket `Request` in `websocket_handshake` by ChihweiLHBird in https://github.com/sanic-org/sanic/pull/2858
* Introduce ruff execution on the tests folder 2871 by iAndriy in https://github.com/sanic-org/sanic/pull/2872
* Add a REPL to the CLI by ahopkins in https://github.com/sanic-org/sanic/pull/2859
* Use trusted publisher by prryplatypus in https://github.com/sanic-org/sanic/pull/2877
* Support for Python 3.12 2836 by iAndriy in https://github.com/sanic-org/sanic/pull/2870
* Introduce ruff execution on the guides folder 2876 by iAndriy in https://github.com/sanic-org/sanic/pull/2879
* Introduce dynamic port fixture for test_app and helper function for tests which require port within a loop. by iAndriy in https://github.com/sanic-org/sanic/pull/2882
* Start and restart arbitrary processes by ahopkins in https://github.com/sanic-org/sanic/pull/2775

23.6.0

Features
- [2670](https://github.com/sanic-org/sanic/pull/2670) Increase `KEEP_ALIVE_TIMEOUT` default to 120 seconds
- [2716](https://github.com/sanic-org/sanic/pull/2716) Adding allow route overwrite option in blueprint
- [2724](https://github.com/sanic-org/sanic/pull/2724) and [#2792](https://github.com/sanic-org/sanic/pull/2792) Add a new exception signal for ALL exceptions raised anywhere in application
- [2727](https://github.com/sanic-org/sanic/pull/2727) Add name prefixing to BP groups
- [2754](https://github.com/sanic-org/sanic/pull/2754) Update request type on middleware types
- [2770](https://github.com/sanic-org/sanic/pull/2770) Better exception message on startup time application induced import error
- [2776](https://github.com/sanic-org/sanic/pull/2776) Set multiprocessing start method early
- [2785](https://github.com/sanic-org/sanic/pull/2785) Add custom typing to config and ctx objects
- [2790](https://github.com/sanic-org/sanic/pull/2790) Add `request.client_ip`

Bugfixes
- [2728](https://github.com/sanic-org/sanic/pull/2728) Fix traversals for intended results
- [2729](https://github.com/sanic-org/sanic/pull/2729) Handle case when headers argument of ResponseStream constructor is None
- [2737](https://github.com/sanic-org/sanic/pull/2737) Fix type annotation for `JSONREsponse` default content type
- [2740](https://github.com/sanic-org/sanic/pull/2740) Use Sanic's serializer for JSON responses in the Inspector
- [2760](https://github.com/sanic-org/sanic/pull/2760) Support for `Request.get_current` in ASGI mode
- [2773](https://github.com/sanic-org/sanic/pull/2773) Alow Blueprint routes to explicitly define error_format
- [2774](https://github.com/sanic-org/sanic/pull/2774) Resolve headers on different renderers
- [2782](https://github.com/sanic-org/sanic/pull/2782) Resolve pypy compatibility issues

Deprecations and Removals
- [2777](https://github.com/sanic-org/sanic/pull/2777) Remove Python 3.7 support

Developer infrastructure
- [2766](https://github.com/sanic-org/sanic/pull/2766) Unpin setuptools version
- [2779](https://github.com/sanic-org/sanic/pull/2779) Run keep alive tests in loop to get available port

Improved Documentation
- [2741](https://github.com/sanic-org/sanic/pull/2741) Better documentation examples about running Sanic
From that list, the items to highlight in the release notes:

---

What's Changed
* Fix JSONResponse default content type by prryplatypus in https://github.com/sanic-org/sanic/pull/2737
* Fix issue in getting current request through classmethod when served through a different ASGI server by Thirumalai in https://github.com/sanic-org/sanic/pull/2760
* Unpin setuptools version by ChihweiLHBird in https://github.com/sanic-org/sanic/pull/2766
* Sanic on pypy by deounix in https://github.com/sanic-org/sanic/pull/2682
* fix examples for freeze_support() issue on windows by deounix in https://github.com/sanic-org/sanic/pull/2741
* fix 2757 - Improved error messaging on startup time application induced import error by moshe742 in https://github.com/sanic-org/sanic/pull/2770
* Fix Inner bug: TypeError: __init__() got an unexpected keyword argument 'escape_forward_slashes' 2740 by chidoben in https://github.com/sanic-org/sanic/pull/2772
* Add name prefixing to BP groups by ahopkins in https://github.com/sanic-org/sanic/pull/2727
* Adding allow route overwrite option in blueprint by ChihweiLHBird in https://github.com/sanic-org/sanic/pull/2716
* Fix traversals for intended results by ahopkins in https://github.com/sanic-org/sanic/pull/2728
* Update request type on middleware types by guacs in https://github.com/sanic-org/sanic/pull/2754
* Resolve headers on different renderers - Issue 2749 by ahopkins in https://github.com/sanic-org/sanic/pull/2774
* Handle case when `headers` argument of `ResponseStream` constructor is `None` by liamcoatman in https://github.com/sanic-org/sanic/pull/2729
* Add a new exception signal for ALL exceptions raised anywhere in application by ahopkins in https://github.com/sanic-org/sanic/pull/2724
* Alow Blueprint routes to explicitly define error_format by moshe742 in https://github.com/sanic-org/sanic/pull/2773
* Remove Python3.7 support by ahopkins in https://github.com/sanic-org/sanic/pull/2777
* Set multiprocessing start method early by ahopkins in https://github.com/sanic-org/sanic/pull/2776
* Run keep alive tests in loop to get available port by ahopkins in https://github.com/sanic-org/sanic/pull/2779
* Increase KEEP_ALIVE_TIMEOUT default to 120 seconds by Tronic in https://github.com/sanic-org/sanic/pull/2670
* Update bug-report.yml by ahopkins in https://github.com/sanic-org/sanic/pull/2787
* Update bug-report.yml by ahopkins in https://github.com/sanic-org/sanic/pull/2788
* Add custom typing to config and ctx by ahopkins in https://github.com/sanic-org/sanic/pull/2785
* Add request.client_ip by Tronic in https://github.com/sanic-org/sanic/pull/2790
* Add convenience method for exception reporting by ahopkins in https://github.com/sanic-org/sanic/pull/2792
* Prepare for v23.6 release by ahopkins in https://github.com/sanic-org/sanic/pull/2797

New Contributors
* Thirumalai made their first contribution in https://github.com/sanic-org/sanic/pull/2760
* moshe742 made their first contribution in https://github.com/sanic-org/sanic/pull/2770
* chidoben made their first contribution in https://github.com/sanic-org/sanic/pull/2772
* guacs made their first contribution in https://github.com/sanic-org/sanic/pull/2754
* liamcoatman made their first contribution in https://github.com/sanic-org/sanic/pull/2729

**Full Changelog**: https://github.com/sanic-org/sanic/compare/v23.3.0...v23.6.0

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



---

New Contributors
* r0x0d made their first contribution in https://github.com/sanic-org/sanic/pull/2666
* deounix made their first contribution in https://github.com/sanic-org/sanic/pull/2680
* mbendiksen made their first contribution in https://github.com/sanic-org/sanic/pull/2712
* stricaud made their first contribution in https://github.com/sanic-org/sanic/pull/2697

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

22.12.0

Features

- [2569](https://github.com/sanic-org/sanic/pull/2569) Add `JSONResponse` class with some convenient methods when updating a response object
- [2598](https://github.com/sanic-org/sanic/pull/2598) Change `uvloop` requirement to `>=0.15.0`
- [2609](https://github.com/sanic-org/sanic/pull/2609) Add compatibility with `websockets` v11.0
- [2610](https://github.com/sanic-org/sanic/pull/2610) Kill server early on worker error
- Raise deadlock timeout to 30s
- [2617](https://github.com/sanic-org/sanic/pull/2617) Scale number of running server workers
- [2621](https://github.com/sanic-org/sanic/pull/2621) [#2634](https://github.com/sanic-org/sanic/pull/2634) Send `SIGKILL` on subsequent `ctrl+c` to force worker exit
- [2622](https://github.com/sanic-org/sanic/pull/2622) Add API to restart all workers from the multiplexer
- [2624](https://github.com/sanic-org/sanic/pull/2624) Default to `spawn` for all subprocesses unless specifically set:
python
from sanic import Sanic

Sanic.start_method = "fork"

- [2625](https://github.com/sanic-org/sanic/pull/2625) Filename normalisation of form-data/multipart file uploads
- [2626](https://github.com/sanic-org/sanic/pull/2626) Move to HTTP Inspector:
- Remote access to inspect running Sanic instances
- TLS support for encrypted calls to Inspector
- Authentication to Inspector with API key
- Ability to extend Inspector with custom commands
- [2632](https://github.com/sanic-org/sanic/pull/2632) Control order of restart operations
- [2633](https://github.com/sanic-org/sanic/pull/2633) Move reload interval to class variable
- [2636](https://github.com/sanic-org/sanic/pull/2636) Add `priority` to `register_middleware` method
- [2639](https://github.com/sanic-org/sanic/pull/2639) Add `unquote` to `add_route` method
- [2640](https://github.com/sanic-org/sanic/pull/2640) ASGI websockets to receive `text` or `bytes`


Bugfixes

- [2607](https://github.com/sanic-org/sanic/pull/2607) Force socket shutdown before close to allow rebinding
- [2590](https://github.com/sanic-org/sanic/pull/2590) Use actual `StrEnum` in Python 3.11+
- [2615](https://github.com/sanic-org/sanic/pull/2615) Ensure middleware executes only once per request timeout
- [2627](https://github.com/sanic-org/sanic/pull/2627) Crash ASGI application on lifespan failure
- [2635](https://github.com/sanic-org/sanic/pull/2635) Resolve error with low-level server creation on Windows


Deprecations and Removals

- [2608](https://github.com/sanic-org/sanic/pull/2608) [#2630](https://github.com/sanic-org/sanic/pull/2630) Signal conditions and triggers saved on `signal.extra`
- [2626](https://github.com/sanic-org/sanic/pull/2626) Move to HTTP Inspector
- 🚨 *BREAKING CHANGE*: Moves the Inspector to a Sanic app from a simple TCP socket with a custom protocol
- *DEPRECATE*: The `--inspect*` commands have been deprecated in favor of `inspect ...` commands
- [2628](https://github.com/sanic-org/sanic/pull/2628) Replace deprecated `distutils.strtobool`


Developer infrastructure

- [2612](https://github.com/sanic-org/sanic/pull/2612) Add CI testing for Python 3.11

---


**Full Changelog**: https://github.com/sanic-org/sanic/compare/v22.9.1...v22.12.0

Page 1 of 12

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.