Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6102b4b

Browse files
Merge branch 'master' into disable-wchar-cache
2 parents d529224 + 7fed755 commit 6102b4b

40 files changed

Lines changed: 2642 additions & 2730 deletions

Doc/c-api/long.rst

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,7 @@ distinguished from a number. Use :c:func:`PyErr_Occurred` to disambiguate.
9797
.. c:function:: PyObject* PyLong_FromUnicodeObject(PyObject *u, int base)
9898
9999
Convert a sequence of Unicode digits in the string *u* to a Python integer
100-
value. The Unicode string is first encoded to a byte string using
101-
:c:func:`PyUnicode_EncodeDecimal` and then converted using
102-
:c:func:`PyLong_FromString`.
100+
value.
103101
104102
.. versionadded:: 3.3
105103

Doc/library/asyncio-task.rst

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -962,31 +962,6 @@ Task Object
962962

963963
.. versionadded:: 3.8
964964

965-
.. classmethod:: all_tasks(loop=None)
966-
967-
Return a set of all tasks for an event loop.
968-
969-
By default all tasks for the current event loop are returned.
970-
If *loop* is ``None``, the :func:`get_event_loop` function
971-
is used to get the current loop.
972-
973-
.. deprecated-removed:: 3.7 3.9
974-
975-
Do not call this as a task method. Use the :func:`asyncio.all_tasks`
976-
function instead.
977-
978-
.. classmethod:: current_task(loop=None)
979-
980-
Return the currently running task or ``None``.
981-
982-
If *loop* is ``None``, the :func:`get_event_loop` function
983-
is used to get the current loop.
984-
985-
.. deprecated-removed:: 3.7 3.9
986-
987-
Do not call this as a task method. Use the
988-
:func:`asyncio.current_task` function instead.
989-
990965

991966
.. _asyncio_generator_based_coro:
992967

Doc/library/typing.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -672,7 +672,7 @@ The module defines the following classes, functions and decorators:
672672
A generic version of :class:`collections.abc.ByteString`.
673673

674674
This type represents the types :class:`bytes`, :class:`bytearray`,
675-
and :class:`memoryview`.
675+
and :class:`memoryview` of byte sequences.
676676

677677
As a shorthand for this type, :class:`bytes` can be used to
678678
annotate arguments of any of the types mentioned above.

Doc/library/unittest.rst

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -950,6 +950,9 @@ Test cases
950950
| :meth:`assertLogs(logger, level) | The ``with`` block logs on *logger* | 3.4 |
951951
| <TestCase.assertLogs>` | with minimum *level* | |
952952
+---------------------------------------------------------+--------------------------------------+------------+
953+
| :meth:`assertNoLogs(logger, level) | The ``with`` block does not log on | 3.10 |
954+
| <TestCase.assertNoLogs>` | *logger* with minimum *level* | |
955+
+---------------------------------------------------------+--------------------------------------+------------+
953956

954957
.. method:: assertRaises(exception, callable, *args, **kwds)
955958
assertRaises(exception, *, msg=None)
@@ -1121,6 +1124,24 @@ Test cases
11211124

11221125
.. versionadded:: 3.4
11231126

1127+
.. method:: assertNoLogs(logger=None, level=None)
1128+
1129+
A context manager to test that no messages are logged on
1130+
the *logger* or one of its children, with at least the given
1131+
*level*.
1132+
1133+
If given, *logger* should be a :class:`logging.Logger` object or a
1134+
:class:`str` giving the name of a logger. The default is the root
1135+
logger, which will catch all messages.
1136+
1137+
If given, *level* should be either a numeric logging level or
1138+
its string equivalent (for example either ``"ERROR"`` or
1139+
:attr:`logging.ERROR`). The default is :attr:`logging.INFO`.
1140+
1141+
Unlike :meth:`assertLogs`, nothing will be returned by the context
1142+
manager.
1143+
1144+
.. versionadded:: 3.10
11241145

11251146
There are also other methods used to perform more specific checks, such as:
11261147

Doc/myfile.bz2

-331 Bytes
Binary file not shown.

Doc/whatsnew/3.9.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -878,6 +878,11 @@ Removed
878878
deprecated since 2006, and only returning ``False`` when it's called.
879879
(Contributed by Batuhan Taskaya in :issue:`40208`)
880880

881+
* The :meth:`asyncio.Task.current_task` and :meth:`asyncio.Task.all_tasks` have
882+
have been removed. They were deprecated since Python 3.7 and you can use
883+
:func:`asyncio.current_task` and :func:`asyncio.all_tasks` instead.
884+
(Contributed by Rémi Lapeyre in :issue:`40967`)
885+
881886

882887
Porting to Python 3.9
883888
=====================

Include/cpython/unicodeobject.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -993,7 +993,7 @@ Py_DEPRECATED(3.3) PyAPI_FUNC(PyObject*) PyUnicode_EncodeMBCS(
993993
994994
*/
995995

996-
/* Py_DEPRECATED(3.3) */ PyAPI_FUNC(int) PyUnicode_EncodeDecimal(
996+
Py_DEPRECATED(3.3) PyAPI_FUNC(int) PyUnicode_EncodeDecimal(
997997
Py_UNICODE *s, /* Unicode buffer */
998998
Py_ssize_t length, /* Number of Py_UNICODE chars to encode */
999999
char *output, /* Output buffer; must have size >= length */
@@ -1006,7 +1006,7 @@ Py_DEPRECATED(3.3) PyAPI_FUNC(PyObject*) PyUnicode_EncodeMBCS(
10061006
Returns a new Unicode string on success, NULL on failure.
10071007
*/
10081008

1009-
/* Py_DEPRECATED(3.3) */
1009+
Py_DEPRECATED(3.3)
10101010
PyAPI_FUNC(PyObject*) PyUnicode_TransformDecimalToASCII(
10111011
Py_UNICODE *s, /* Unicode buffer */
10121012
Py_ssize_t length /* Number of Py_UNICODE chars to transform */

Include/internal/pycore_pylifecycle.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ extern void _PyGC_Fini(PyThreadState *tstate);
7878
extern void _PyType_Fini(void);
7979
extern void _Py_HashRandomization_Fini(void);
8080
extern void _PyUnicode_Fini(PyThreadState *tstate);
81+
extern void _PyUnicode_ClearInterned(PyThreadState *tstate);
8182
extern void _PyLong_Fini(PyThreadState *tstate);
8283
extern void _PyFaulthandler_Fini(void);
8384
extern void _PyHash_Fini(void);

Lib/asyncio/tasks.py

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -113,34 +113,6 @@ class Task(futures._PyFuture): # Inherit Python Task implementation
113113
# status is still pending
114114
_log_destroy_pending = True
115115

116-
@classmethod
117-
def current_task(cls, loop=None):
118-
"""Return the currently running task in an event loop or None.
119-
120-
By default the current task for the current event loop is returned.
121-
122-
None is returned when called not in the context of a Task.
123-
"""
124-
warnings.warn("Task.current_task() is deprecated since Python 3.7, "
125-
"use asyncio.current_task() instead",
126-
DeprecationWarning,
127-
stacklevel=2)
128-
if loop is None:
129-
loop = events.get_event_loop()
130-
return current_task(loop)
131-
132-
@classmethod
133-
def all_tasks(cls, loop=None):
134-
"""Return a set of all tasks for an event loop.
135-
136-
By default all tasks for the current event loop are returned.
137-
"""
138-
warnings.warn("Task.all_tasks() is deprecated since Python 3.7, "
139-
"use asyncio.all_tasks() instead",
140-
DeprecationWarning,
141-
stacklevel=2)
142-
return _all_tasks_compat(loop)
143-
144116
def __init__(self, coro, *, loop=None, name=None):
145117
super().__init__(loop=loop)
146118
if self._source_traceback:

Lib/site.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -462,9 +462,9 @@ def register_readline():
462462
def write_history():
463463
try:
464464
readline.write_history_file(history)
465-
except (FileNotFoundError, PermissionError):
466-
# home directory does not exist or is not writable
467-
# https://bugs.python.org/issue19891
465+
except OSError:
466+
# bpo-19891, bpo-41193: Home directory does not exist
467+
# or is not writable, or the filesystem is read-only.
468468
pass
469469

470470
atexit.register(write_history)

0 commit comments

Comments
 (0)