@@ -5,6 +5,71 @@ Release history
55
66.. towncrier release notes start
77
8+ Trio 0.28.0 (2024-12-25)
9+ ------------------------
10+
11+ Bugfixes
12+ ~~~~~~~~
13+
14+ - :func: `inspect.iscoroutinefunction ` and the like now give correct answers when
15+ called on KI-protected functions. (`#2670 <https://github.com/python-trio/trio/issues/2670 >`__)
16+ - Rework KeyboardInterrupt protection to track code objects, rather than frames,
17+ as protected or not. The new implementation no longer needs to access
18+ ``frame.f_locals `` dictionaries, so it won't artificially extend the lifetime of
19+ local variables. Since KeyboardInterrupt protection is now imposed statically
20+ (when a protected function is defined) rather than each time the function runs,
21+ its previously-noticeable performance overhead should now be near zero.
22+ The lack of a call-time wrapper has some other benefits as well:
23+
24+ * :func: `inspect.iscoroutinefunction ` and the like now give correct answers when
25+ called on KI-protected functions.
26+
27+ * Calling a synchronous KI-protected function no longer pushes an additional stack
28+ frame, so tracebacks are clearer.
29+
30+ * A synchronous KI-protected function invoked from C code (such as a weakref
31+ finalizer) is now guaranteed to start executing; previously there would be a brief
32+ window in which KeyboardInterrupt could be raised before the protection was
33+ established.
34+
35+ One minor drawback of the new approach is that multiple instances of the same
36+ closure share a single KeyboardInterrupt protection state (because they share a
37+ single code object). That means that if you apply
38+ `@enable_ki_protection <trio.lowlevel.enable_ki_protection> ` to some of them
39+ and not others, you won't get the protection semantics you asked for. See the
40+ documentation of `@enable_ki_protection <trio.lowlevel.enable_ki_protection> `
41+ for more details and a workaround. (`#3108 <https://github.com/python-trio/trio/issues/3108 >`__)
42+ - Rework foreign async generator finalization to track async generator
43+ ids rather than mutating ``ag_frame.f_locals ``. This fixes an issue
44+ with the previous implementation: locals' lifetimes will no longer be
45+ extended by materialization in the ``ag_frame.f_locals `` dictionary that
46+ the previous finalization dispatcher logic needed to access to do its work. (`#3112 <https://github.com/python-trio/trio/issues/3112 >`__)
47+ - Ensure that Pyright recognizes our underscore prefixed attributes for attrs classes. (`#3114 <https://github.com/python-trio/trio/issues/3114 >`__)
48+ - Fix `trio.testing.RaisesGroup `'s typing. (`#3141 <https://github.com/python-trio/trio/issues/3141 >`__)
49+
50+
51+ Improved documentation
52+ ~~~~~~~~~~~~~~~~~~~~~~
53+
54+ - Improve error message when run after gevent's monkey patching. (`#3087 <https://github.com/python-trio/trio/issues/3087 >`__)
55+ - Document that :func: `trio.sleep_forever ` is guaranteed to raise an exception now. (`#3113 <https://github.com/python-trio/trio/issues/3113 >`__)
56+
57+
58+ Removals without deprecations
59+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
60+
61+ - Remove workaround for OpenSSL 1.1.1 DTLS ClientHello bug. (`#3097 <https://github.com/python-trio/trio/issues/3097 >`__)
62+ - Drop support for Python 3.8. (`#3104 <https://github.com/python-trio/trio/issues/3104 >`__) (`#3106 <https://github.com/python-trio/trio/issues/3106 >`__)
63+
64+
65+ Miscellaneous internal changes
66+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
67+
68+ - Switch to using PEP570 for positional-only arguments for `~trio.socket.SocketType `'s methods. (`#3094 <https://github.com/python-trio/trio/issues/3094 >`__)
69+ - Improve type annotations in several places by removing `Any ` usage. (`#3121 <https://github.com/python-trio/trio/issues/3121 >`__)
70+ - Get and enforce 100% coverage (`#3159 <https://github.com/python-trio/trio/issues/3159 >`__)
71+
72+
873Trio 0.27.0 (2024-10-17)
974------------------------
1075
0 commit comments