Changelogs » Asgiref

PyUp Safety actively tracks 268,179 Python packages for vulnerabilities and notifies you when to upgrade.

Asgiref

3.3.0

------------------
  
  * sync_to_async now defaults to thread-sensitive mode being on
  * async_to_sync now works inside of forked processes
  * WsgiToAsgi now correctly clamps its response body when Content-Length is set

3.2.10

-------------------
  
  * Fixed bugs due to bad WeakRef handling introduced in 3.2.8

3.2.9

------------------
  
  * Fixed regression with exception handling in 3.2.8 related to the contextvars fix.

3.2.8

------------------
  
  * Fixed small memory leak in local.Local
  * contextvars are now persisted through AsyncToSync

3.2.7

------------------
  
  * Bug fixed in local.Local where deleted Locals would occasionally inherit
  their storage into new Locals due to memory reuse.

3.2.6

------------------
  
  * local.Local now works in all threading situations, no longer requires
  periodic garbage collection, and works with libraries that monkeypatch
  threading (like gevent)

3.2.5

------------------
  
  * __self__ is now preserved on methods by async_to_sync

3.2.4

------------------
  
  * Pending tasks/async generators are now cancelled when async_to_sync exits
  * Contextvars now propagate changes both ways through sync_to_async
  * sync_to_async now preserves attributes on functions it wraps

3.2.3

------------------
  
  * Added support and testing for Python 3.8.

3.2.2

------------------
  
  * WsgiToAsgi maps multi-part request bodies into a single WSGI input file
  * WsgiToAsgi passes the `root_path` scope as SCRIPT_NAME
  * WsgiToAsgi now checks the scope type to handle `lifespan` better
  * WsgiToAsgi now passes the server port as a string, like WSGI
  * SyncToAsync values are now identified as coroutine functions by asyncio
  * SyncToAsync now handles __self__ correctly for methods

3.2.1

------------------
  
  * sys.exc_info() is now propagated across thread boundaries

3.2.0

------------------
  
  * New "thread_sensitive" argument to SyncToAsync allows for pinning of code into
  the same thread as other thread_sensitive code.
  * Test collection on Python 3.7 fixed

3.1.4

------------------
  
  * Fixed an incompatibility with Python 3.5 introduced in the last release.

3.1.3

------------------
  
  * async_timeout has been removed as a dependency, so there are now no required
  dependencies.
  * The WSGI adapter now sets ``REMOTE_ADDR`` from the ASGI ``client``.

3.1.2

------------------
  
  * New thread_critical argument to Local to tell it to not inherit contexts
  across threads/tasks.
  * Local now inherits across any number of sync_to_async to async_to_sync calls
  nested inside each other

3.1.1

------------------
  
  * Local now cleans up storage of old threads and tasks to prevent a memory leak.

3.1.0

------------------
  
  * Added ``asgiref.local`` module to provide threading.local drop-in replacement.

3.0.0

------------------
  
  * Updated to match new ASGI 3.0 spec
  * Compatibility library added that allows adapting ASGI 2 apps into ASGI 3 apps
  losslessly

2.3.2

------------------
  
  * Packaging fix to allow old async_timeout dependencies (2.0 as well as 3.0)

2.3.1

------------------
  
  * WSGI-to-ASGI adapter now works with empty bodies in responses
  * Update async-timeout dependency

2.3.0

------------------
  
  * ApplicationCommunicator now has a receive_nothing() test available

2.2.0

------------------
  
  * Cancelled tasks now correctly cascade-cancel their children
  
  * Communicator.wait() no longer re-raises CancelledError from inner coroutines

2.1.6

------------------
  
  * async_to_sync now works inside of threads (but is still not allowed in threads
  that have an active event loop)

2.1.5

------------------
  
  * Fixed issues with async_to_sync not setting the event loop correctly
  
  * Stop async_to_sync being called from threads with an active event loop

2.1.4

------------------
  
  * Values are now correctly returned from sync_to_async and async_to_sync
  
  * ASGI_THREADS environment variable now works correctly

2.1.3

------------------
  
  * Add an ApplicationCommunicator.wait() method to allow you to wait for an
  application instance to exit before seeing what it did.

2.1.2

------------------
  
  * Allow AsyncToSync to work if called from a non-async-wrapped sync context.

2.1.1

------------------
  
  * Allow AsyncToSync constructor to be called inside SyncToAsync.

2.1.0

------------------
  
  * Add `asgiref.testing` module with ApplicationCommunicator testing helper

2.0.1

------------------
  
  * Bugfix release to have HTTP response content message as the correct
  "http.response.content" not the older "http.response.chunk".

2.0.0

------------------
  
  * Complete rewrite for new async-based ASGI mechanisms and removal of
  channel layers.

1.1.2

-----------------
  
  * Conformance test suite now allows for retries and tests group_send's behaviour with capacity
  * valid_channel_names now has a receive parameter

1.1.1

------------------
  
  * Error with sending to multi-process channels with the same message fixed

1.1.0

------------------
  
  * Process-specific channel behaviour has been changed, and the base layer
  and conformance suites updated to match.

1.0.1

------------------
  
  * Improved channel and group name validation
  * Test rearrangements and improvements

1.0.0

------------------
  
  * `receive_many` is now `receive`
  * In-memory layer deepcopies messages so they cannot be mutated post-send
  * Better errors for bad channel/group names