Skip to content

Commit a78887a

Browse files
authored
Bump version to 0.34.0 (#3491)
* Bump version to 0.34.0 * Start new cycle
2 parents a443d4e + d3ff045 commit a78887a

12 files changed

Lines changed: 42 additions & 53 deletions

File tree

docs/source/history.rst

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,41 @@ Release history
55

66
.. towncrier release notes start
77
8+
trio 0.34.0 (2026-08-10)
9+
------------------------
10+
11+
Features
12+
~~~~~~~~
13+
14+
- `MemoryChannelStatistics` now has a ``peak_buffer_used`` field, which reports
15+
the largest number of items that have ever been in the channel's buffer at
16+
once. This makes it easier to pick a sensible ``max_buffer_size`` based on
17+
data from a real run, instead of guessing. (`#1723 <https://github.com/python-trio/trio/issues/1723>`__)
18+
- Support Python 3.15, as of beta 4. Things may still change and so this
19+
support may break in the future. (`#3456 <https://github.com/python-trio/trio/issues/3456>`__)
20+
21+
22+
Bugfixes
23+
~~~~~~~~
24+
25+
- ``Nursery.start()`` now preserves the ``__cause__`` and ``__context__`` of
26+
exceptions raised before ``task_status.started()`` is called. (`#3261 <https://github.com/python-trio/trio/issues/3261>`__)
27+
- Fixed incorrect error message in ``run_process``: the ``stdout`` pipe check now correctly says "stdout" instead of "stdin". (`#3409 <https://github.com/python-trio/trio/issues/3409>`__)
28+
- Fixed ``trio.Path.as_uri()`` on Python 3.14+ to avoid the deprecated ``pathlib.PurePath.as_uri()`` path. (`#3460 <https://github.com/python-trio/trio/issues/3460>`__)
29+
- Fixed ``trio.to_thread.run_sync``` workers leaking spawner's ``Context`` on ``py314t+`` free-threaded builds. (`#3472 <https://github.com/python-trio/trio/issues/3472>`__)
30+
31+
32+
Deprecations and removals
33+
~~~~~~~~~~~~~~~~~~~~~~~~~
34+
35+
- Trying to use absolute deadlines on a `trio.CancelScope` constructed
36+
with a relative deadline now raises, after being deprecated since Trio
37+
0.27.0.
38+
39+
To switch a cancel scope from being relative to absolute, replace the
40+
`trio.CancelScope` object instead of trying to mutate it. (`#3403 <https://github.com/python-trio/trio/issues/3403>`__)
41+
42+
843
trio 0.33.0 (2026-02-14)
944
------------------------
1045

newsfragments/1723.feature.rst

Lines changed: 0 additions & 4 deletions
This file was deleted.

newsfragments/3261.bugfix.rst

Lines changed: 0 additions & 2 deletions
This file was deleted.

newsfragments/3403.deprecated.rst

Lines changed: 0 additions & 6 deletions
This file was deleted.

newsfragments/3409.bugfix.rst

Lines changed: 0 additions & 1 deletion
This file was deleted.

newsfragments/3456.feature.rst

Lines changed: 0 additions & 2 deletions
This file was deleted.

newsfragments/3460.bugfix.rst

Lines changed: 0 additions & 1 deletion
This file was deleted.

newsfragments/3472.bugfix.rst

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/trio/_core/_tests/test_asyncgen.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ async def test_fallback_when_no_hook_claims_it(
278278
async def well_behaved() -> AsyncGenerator[int, None]:
279279
yield 42
280280

281-
# noqas because we *want* to test delayed yield/await!
281+
# these noqas are because we *want* to test delayed yield/await!
282282
async def yields_after_yield() -> AsyncGenerator[int, None]:
283283
with pytest.raises(GeneratorExit):
284284
yield 42 # noqa: ASYNC119

src/trio/_sync.py

Lines changed: 4 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from __future__ import annotations
22

33
import math
4-
from typing import TYPE_CHECKING, Literal, Protocol, TypeVar
4+
from typing import TYPE_CHECKING, Literal, Protocol
55

66
import attrs
77

@@ -16,31 +16,13 @@
1616
enable_ki_protection,
1717
remove_parking_lot_breaker,
1818
)
19-
from ._deprecate import warn_deprecated
2019
from ._util import final
2120

2221
if TYPE_CHECKING:
23-
from collections.abc import Callable
2422
from types import TracebackType
2523

26-
from typing_extensions import deprecated
27-
2824
from ._core import Task
2925
from ._core._parking_lot import ParkingLotStatistics
30-
else:
31-
T = TypeVar("T")
32-
33-
def deprecated(
34-
message: str,
35-
/,
36-
*,
37-
category: type[Warning] | None = DeprecationWarning,
38-
stacklevel: int = 1,
39-
) -> Callable[[T], T]:
40-
def wrapper(f: T) -> T:
41-
return f
42-
43-
return wrapper
4426

4527

4628
@attrs.frozen
@@ -130,19 +112,11 @@ def statistics(self) -> EventStatistics:
130112
"""
131113
return EventStatistics(tasks_waiting=len(self._tasks))
132114

133-
@deprecated(
134-
"trio.Event.__bool__ is deprecated since Trio 0.31.0; use trio.Event.is_set instead (https://github.com/python-trio/trio/issues/3238)",
135-
stacklevel=2,
136-
)
137115
def __bool__(self) -> Literal[True]:
138-
"""Return True and raise warning."""
139-
warn_deprecated(
140-
self.__bool__,
141-
"0.31.0",
142-
issue=3238,
143-
instead=self.is_set,
116+
"""Raise error."""
117+
raise NotImplementedError(
118+
"Trio events cannot be treated as bools; consider using `event.is_set()` instead."
144119
)
145-
return True
146120

147121

148122
class _HasAcquireRelease(Protocol):

0 commit comments

Comments
 (0)