bottle
bottle copied to clipboard
Migrate from threading.local to contextvars
LocalRequest and LocalResponse now use ContextVar instead of threading.local() to implement thread-local state. This is natively supported by greenlet and monkey-patching the threading library is no longer needeed to support greenlet-based servers (e.g. gunicorn with gevent worker).
The Cheetah template adapter was changed to no longer depend on any form of thread-local state.
The module-global local variable is still an instance of threading.local, but not used by bottle and now deprecated.