Skip to content

Commit 9e1a88f

Browse files
Merge branch 'main' into realpath-all-but-last
2 parents 63f6c0c + e007e62 commit 9e1a88f

File tree

3 files changed

+38
-6
lines changed

3 files changed

+38
-6
lines changed

Doc/whatsnew/3.13.rst

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -730,6 +730,22 @@ asyncio
730730
never awaited).
731731
(Contributed by Arthur Tacca and Jason Zhang in :gh:`115957`.)
732732

733+
* The function and methods named ``create_task`` have received a new
734+
``**kwargs`` argument that is passed through to the task constructor.
735+
This change was accidentally added in 3.13.3,
736+
and broke the API contract for custom task factories.
737+
Several third-party task factories implemented workarounds for this.
738+
In 3.13.4 and later releases the old factory contract is honored
739+
once again (until 3.14).
740+
To keep the workarounds working, the extra ``**kwargs`` argument still
741+
allows passing additional keyword arguments to :class:`~asyncio.Task`
742+
and to custom task factories.
743+
744+
This affects the following function and methods:
745+
:meth:`asyncio.create_task`,
746+
:meth:`asyncio.loop.create_task`,
747+
:meth:`asyncio.TaskGroup.create_task`.
748+
(Contributed by Thomas Grainger in :gh:`128307`.)
733749

734750
base64
735751
------

Doc/whatsnew/3.14.rst

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1064,6 +1064,24 @@ ast
10641064
(Contributed by Semyon Moroz in :gh:`133367`.)
10651065

10661066

1067+
asyncio
1068+
-------
1069+
1070+
* The function and methods named :func:`!create_task` now take an arbitrary
1071+
list of keyword arguments. All keyword arguments are passed to the
1072+
:class:`~asyncio.Task` constructor or the custom task factory.
1073+
(See :meth:`~asyncio.loop.set_task_factory` for details.)
1074+
The ``name`` and ``context`` keyword arguments are no longer special;
1075+
the name should now be set using the ``name`` keyword argument of the factory,
1076+
and ``context`` may be ``None``.
1077+
1078+
This affects the following function and methods:
1079+
:meth:`asyncio.create_task`,
1080+
:meth:`asyncio.loop.create_task`,
1081+
:meth:`asyncio.TaskGroup.create_task`.
1082+
(Contributed by Thomas Grainger in :gh:`128307`.)
1083+
1084+
10671085
bdb
10681086
---
10691087

Modules/_cursesmodule.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -392,17 +392,16 @@ _PyCursesStatefulCheckFunction(PyObject *module,
392392
*/
393393

394394
/*
395-
* Return None if 'code' is OK. Otherwise, set an exception
396-
* using curses_set_error() and the remaining arguments, and
397-
* return NULL.
395+
* Return None if 'code' is different from ERR (implementation-defined).
396+
* Otherwise, set an exception using curses_set_error() and the remaining
397+
* arguments, and return NULL.
398398
*/
399399
static PyObject *
400400
curses_check_err(PyObject *module, int code,
401401
const char *curses_funcname,
402402
const char *python_funcname)
403403
{
404404
if (code != ERR) {
405-
assert(code == OK);
406405
Py_RETURN_NONE;
407406
}
408407
curses_set_error(module, curses_funcname, python_funcname);
@@ -416,7 +415,6 @@ curses_window_check_err(PyCursesWindowObject *win, int code,
416415
const char *python_funcname)
417416
{
418417
if (code != ERR) {
419-
assert(code == OK);
420418
Py_RETURN_NONE;
421419
}
422420
curses_window_set_error(win, curses_funcname, python_funcname);
@@ -1580,7 +1578,7 @@ _curses_window_derwin_impl(PyCursesWindowObject *self, int group_left_1,
15801578
win = derwin(self->win,nlines,ncols,begin_y,begin_x);
15811579

15821580
if (win == NULL) {
1583-
curses_window_set_error(self, "derwin", NULL);
1581+
curses_window_set_null_error(self, "derwin", NULL);
15841582
return NULL;
15851583
}
15861584

0 commit comments

Comments
 (0)