Skip to content

Commit b26b204

Browse files
Merge branch 'main' into use-extra-assertions
2 parents 3c985b8 + e94d168 commit b26b204

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+360
-261
lines changed

Doc/c-api/unicode.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -596,6 +596,14 @@ APIs:
596596
Objects other than Unicode or its subtypes will cause a :exc:`TypeError`.
597597
598598
599+
.. c:function:: PyObject* PyUnicode_FromOrdinal(int ordinal)
600+
601+
Create a Unicode Object from the given Unicode code point *ordinal*.
602+
603+
The ordinal must be in ``range(0x110000)``. A :exc:`ValueError` is
604+
raised in the case it is not.
605+
606+
599607
.. c:function:: PyObject* PyUnicode_FromEncodedObject(PyObject *obj, \
600608
const char *encoding, const char *errors)
601609

Doc/data/refcounts.dat

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2770,6 +2770,9 @@ PyUnicode_FromFormatV:PyObject*::+1:
27702770
PyUnicode_FromFormatV:const char*:format::
27712771
PyUnicode_FromFormatV:va_list:args::
27722772

2773+
PyUnicode_FromOrdinal:PyObject*::+1:
2774+
PyUnicode_FromOrdinal:int:ordinal::
2775+
27732776
PyUnicode_Append:void:::
27742777
PyUnicode_Append:PyObject**:p_left:0:
27752778
PyUnicode_Append:PyObject*:right::

Doc/library/codecs.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ any codec:
5555

5656
The full details for each codec can also be looked up directly:
5757

58-
.. function:: lookup(encoding)
58+
.. function:: lookup(encoding, /)
5959

6060
Looks up the codec info in the Python codec registry and returns a
6161
:class:`CodecInfo` object as defined below.
@@ -156,7 +156,7 @@ these additional functions which use :func:`lookup` for the codec lookup:
156156
Custom codecs are made available by registering a suitable codec search
157157
function:
158158

159-
.. function:: register(search_function)
159+
.. function:: register(search_function, /)
160160

161161
Register a codec search function. Search functions are expected to take one
162162
argument, being the encoding name in all lower case letters with hyphens
@@ -168,7 +168,7 @@ function:
168168
Hyphens and spaces are converted to underscore.
169169

170170

171-
.. function:: unregister(search_function)
171+
.. function:: unregister(search_function, /)
172172

173173
Unregister a codec search function and clear the registry's cache.
174174
If the search function is not registered, do nothing.
@@ -416,7 +416,7 @@ In addition, the following error handler is specific to the given codecs:
416416
The set of allowed values can be extended by registering a new named error
417417
handler:
418418

419-
.. function:: register_error(name, error_handler)
419+
.. function:: register_error(name, error_handler, /)
420420

421421
Register the error handling function *error_handler* under the name *name*.
422422
The *error_handler* argument will be called during encoding and decoding
@@ -442,7 +442,7 @@ handler:
442442
Previously registered error handlers (including the standard error handlers)
443443
can be looked up by name:
444444

445-
.. function:: lookup_error(name)
445+
.. function:: lookup_error(name, /)
446446

447447
Return the error handler previously registered under the name *name*.
448448

Doc/library/signal.rst

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -510,10 +510,12 @@ The :mod:`signal` module defines the following functions:
510510

511511
.. function:: set_wakeup_fd(fd, *, warn_on_full_buffer=True)
512512

513-
Set the wakeup file descriptor to *fd*. When a signal is received, the
514-
signal number is written as a single byte into the fd. This can be used by
515-
a library to wakeup a poll or select call, allowing the signal to be fully
516-
processed.
513+
Set the wakeup file descriptor to *fd*. When a signal your program has
514+
registered a signal handler for is received, the signal number is written as
515+
a single byte into the fd. If you haven't registered a signal handler for
516+
the signals you care about, then nothing will be written to the wakeup fd.
517+
This can be used by a library to wakeup a poll or select call, allowing the
518+
signal to be fully processed.
517519

518520
The old wakeup fd is returned (or -1 if file descriptor wakeup was not
519521
enabled). If *fd* is -1, file descriptor wakeup is disabled.

Doc/library/socket.rst

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,10 @@ created. Socket addresses are represented as follows:
156156

157157
- :const:`BTPROTO_HCI` accepts a format that depends on your OS.
158158

159-
- On Linux it accepts a tuple ``(device_id,)`` where ``device_id``
160-
is an integer specifying the number of the Bluetooth device.
159+
- On Linux it accepts a tuple ``(device_id, [channel])`` where ``device_id``
160+
is an integer specifying the number of the Bluetooth device,
161+
and ``channel`` is an optional integer specifying the HCI channel
162+
(:const:`HCI_CHANNEL_RAW` by default).
161163
- On FreeBSD, NetBSD and DragonFly BSD it accepts ``bdaddr``
162164
where ``bdaddr`` is the Bluetooth address as a string.
163165

@@ -167,6 +169,9 @@ created. Socket addresses are represented as follows:
167169
.. versionchanged:: 3.13.3
168170
FreeBSD support added.
169171

172+
.. versionchanged:: next
173+
Added ``channel`` field.
174+
170175
- :const:`BTPROTO_SCO` accepts ``bdaddr`` where ``bdaddr`` is
171176
the Bluetooth address as a string or a :class:`bytes` object.
172177
(ex. ``'12:23:34:45:56:67'`` or ``b'12:23:34:45:56:67'``)
@@ -677,6 +682,18 @@ Constants
677682
available on Linux and FreeBSD. :const:`!HCI_TIME_STAMP` and
678683
:const:`!HCI_DATA_DIR` are only available on Linux.
679684

685+
.. data:: HCI_CHANNEL_RAW
686+
HCI_CHANNEL_USER
687+
HCI_CHANNEL_MONITOR
688+
HCI_CHANNEL_CONTROL
689+
HCI_CHANNEL_LOGGING
690+
691+
Possible values for ``channel`` field in the :const:`BTPROTO_HCI` address.
692+
693+
.. availability:: Linux
694+
695+
.. versionadded:: next
696+
680697
.. data:: AF_QIPCRTR
681698

682699
Constant for Qualcomm's IPC router protocol, used to communicate with

Doc/library/sys.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ always available. Unless explicitly noted otherwise, all variables are read-only
130130

131131
.. data:: base_exec_prefix
132132

133-
Equivalent to :data:`exec_prefix`, but refering to the base Python installation.
133+
Equivalent to :data:`exec_prefix`, but referring to the base Python installation.
134134

135135
When running under :ref:`sys-path-init-virtual-environments`,
136136
:data:`exec_prefix` gets overwritten to the virtual environment prefix.
@@ -143,7 +143,7 @@ always available. Unless explicitly noted otherwise, all variables are read-only
143143

144144
.. data:: base_prefix
145145

146-
Equivalent to :data:`prefix`, but refering to the base Python installation.
146+
Equivalent to :data:`prefix`, but referring to the base Python installation.
147147

148148
When running under :ref:`virtual environment <venv-def>`,
149149
:data:`prefix` gets overwritten to the virtual environment prefix.

Doc/library/sys_path_init.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ Please refer to :mod:`site`'s
9797
.. note::
9898

9999
There are other ways how "virtual environments" could be implemented, this
100-
documentation referes implementations based on the ``pyvenv.cfg`` mechanism,
100+
documentation refers implementations based on the ``pyvenv.cfg`` mechanism,
101101
such as :mod:`venv`. Most virtual environment implementations follow the
102102
model set by :mod:`venv`, but there may be exotic implementations that
103103
diverge from it.

Doc/library/test.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -853,7 +853,7 @@ The :mod:`test.support` module defines the following functions:
853853

854854
.. function:: linked_with_musl()
855855

856-
Return ``False`` if there is no evidence the interperter was compiled with
856+
Return ``False`` if there is no evidence the interpreter was compiled with
857857
``musl``, otherwise return a version triple, either ``(0, 0, 0)`` if the
858858
version is unknown, or the actual version if it is known. Intended for use
859859
in ``skip`` decorators. ``emscripten`` and ``wasi`` are assumed to be

Doc/library/urllib.request.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -199,9 +199,9 @@ The :mod:`urllib.request` module defines the following functions:
199199

200200
.. versionchanged:: next
201201
This function calls :func:`socket.gethostbyname` if the URL authority
202-
isn't empty or ``localhost``. If the authority resolves to a local IP
203-
address then it is discarded; otherwise, on Windows a UNC path is
204-
returned (as before), and on other platforms a
202+
isn't empty, ``localhost``, or the machine hostname. If the authority
203+
resolves to a local IP address then it is discarded; otherwise, on
204+
Windows a UNC path is returned (as before), and on other platforms a
205205
:exc:`~urllib.error.URLError` is raised.
206206

207207
.. versionchanged:: next

Include/internal/pycore_pyatomic_ft_wrappers.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,8 @@ extern "C" {
109109
_Py_atomic_store_ullong_relaxed(&value, new_value)
110110
#define FT_ATOMIC_LOAD_ULLONG_RELAXED(value) \
111111
_Py_atomic_load_ullong_relaxed(&value)
112+
#define FT_ATOMIC_ADD_SSIZE(value, new_value) \
113+
(void)_Py_atomic_add_ssize(&value, new_value)
112114

113115
#else
114116
#define FT_ATOMIC_LOAD_PTR(value) value
@@ -156,6 +158,7 @@ extern "C" {
156158
#define FT_ATOMIC_STORE_LLONG_RELAXED(value, new_value) value = new_value
157159
#define FT_ATOMIC_LOAD_ULLONG_RELAXED(value) value
158160
#define FT_ATOMIC_STORE_ULLONG_RELAXED(value, new_value) value = new_value
161+
#define FT_ATOMIC_ADD_SSIZE(value, new_value) (void)(value += new_value)
159162

160163
#endif
161164

0 commit comments

Comments
 (0)