Skip to content

Commit c0c0657

Browse files
committed
Merge branch 'master' into complex-abs-errno/155526
2 parents 4d3badf + f8f8c30 commit c0c0657

63 files changed

Lines changed: 1671 additions & 800 deletions

Some content is hidden

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

Doc/c-api/module.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -853,7 +853,7 @@ struct:
853853
854854
.. versionadded:: 3.5
855855
856-
.. soft-deprecated:: next
856+
.. soft-deprecated:: 3.15
857857
858858
Prefer :c:func:`PyModule_FromSlotsAndSpec` in new code.
859859
@@ -877,7 +877,7 @@ struct:
877877
878878
.. versionadded:: 3.5
879879
880-
.. soft-deprecated:: next
880+
.. soft-deprecated:: 3.15
881881
882882
Prefer :c:func:`PyModule_FromSlotsAndSpec` in new code.
883883
@@ -887,7 +887,7 @@ struct:
887887
888888
.. versionadded:: 3.5
889889
890-
.. soft-deprecated:: next
890+
.. soft-deprecated:: 3.15
891891
892892
To run a module's own execution slots, prefer :c:func:`PyModule_Exec`,
893893
which works on modules that were not created from a

Doc/c-api/type.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -828,7 +828,7 @@ They will continue to work, but new features will be added as slots for
828828
829829
.. versionadded:: 3.12
830830
831-
.. soft-deprecated:: next
831+
.. soft-deprecated:: 3.15
832832
833833
Prefer :c:func:`PyType_FromSlots` in new code.
834834
@@ -859,7 +859,7 @@ They will continue to work, but new features will be added as slots for
859859
Creating classes whose metaclass overrides
860860
:c:member:`~PyTypeObject.tp_new` is no longer allowed.
861861
862-
.. soft-deprecated:: next
862+
.. soft-deprecated:: 3.15
863863
864864
Prefer :c:func:`PyType_FromSlots` in new code.
865865
@@ -885,7 +885,7 @@ They will continue to work, but new features will be added as slots for
885885
Creating classes whose metaclass overrides
886886
:c:member:`~PyTypeObject.tp_new` is no longer allowed.
887887
888-
.. soft-deprecated:: next
888+
.. soft-deprecated:: 3.15
889889
890890
Prefer :c:func:`PyType_FromSlots` in new code.
891891
@@ -910,7 +910,7 @@ They will continue to work, but new features will be added as slots for
910910
Creating classes whose metaclass overrides
911911
:c:member:`~PyTypeObject.tp_new` is no longer allowed.
912912
913-
.. soft-deprecated:: next
913+
.. soft-deprecated:: 3.15
914914
915915
Prefer :c:func:`PyType_FromSlots` in new code.
916916

Doc/library/math.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ noted otherwise, all return values are floats.
9090
:func:`atan(x) <atan>` Arc tangent of *x*, in radians
9191
:func:`atanpi(x) <atanpi>` Arc tangent of *x*, in half-turns
9292
:func:`atan2(y, x) <atan2>` ``atan(y / x)``, in radians
93-
:func:`atan2pi(y, x) <atan2pi>` ``atan(y / x)``, in half-turns
93+
:func:`atan2pi(y, x) <atan2pi>` ``atanpi(y / x)``, in half-turns
9494
:func:`cos(x) <cos>` Cosine of *x* radians
9595
:func:`cospi(x) <cospi>` Cosine of *x⋅π* radians
9696
:func:`sin(x) <sin>` Sine of *x* radians

Doc/library/os.rst

Lines changed: 40 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -574,10 +574,13 @@ process and user.
574574
the groups of which the specified username is a member, plus the specified
575575
group id.
576576

577-
.. availability:: Unix, not WASI, not Android.
577+
.. availability:: Unix, not WASI.
578578

579579
.. versionadded:: 3.2
580580

581+
.. versionchanged:: 3.16
582+
Support for Android now exists.
583+
581584

582585
.. function:: putenv(key, value, /)
583586

@@ -610,21 +613,30 @@ process and user.
610613

611614
Set the current process's effective group id.
612615

613-
.. availability:: Unix, not WASI, not Android.
616+
.. availability:: Unix, not WASI.
617+
618+
.. versionchanged:: 3.16
619+
Support for Android now exists.
614620

615621

616622
.. function:: seteuid(euid, /)
617623

618624
Set the current process's effective user id.
619625

620-
.. availability:: Unix, not WASI, not Android.
626+
.. availability:: Unix, not WASI.
627+
628+
.. versionchanged:: 3.16
629+
Support for Android now exists.
621630

622631

623632
.. function:: setgid(gid, /)
624633

625634
Set the current process' group id.
626635

627-
.. availability:: Unix, not WASI, not Android.
636+
.. availability:: Unix, not WASI.
637+
638+
.. versionchanged:: 3.16
639+
Support for Android now exists.
628640

629641

630642
.. function:: setgroups(groups, /)
@@ -718,32 +730,44 @@ process and user.
718730

719731
Set the current process's real and effective group ids.
720732

721-
.. availability:: Unix, not WASI, not Android.
733+
.. availability:: Unix, not WASI.
734+
735+
.. versionchanged:: 3.16
736+
Support for Android now exists.
722737

723738

724739
.. function:: setresgid(rgid, egid, sgid, /)
725740

726741
Set the current process's real, effective, and saved group ids.
727742

728-
.. availability:: Unix, not WASI, not Android, not macOS, not iOS.
743+
.. availability:: Unix, not WASI, not macOS, not iOS.
729744

730745
.. versionadded:: 3.2
731746

747+
.. versionchanged:: 3.16
748+
Support for Android now exists.
749+
732750

733751
.. function:: setresuid(ruid, euid, suid, /)
734752

735753
Set the current process's real, effective, and saved user ids.
736754

737-
.. availability:: Unix, not WASI, not Android, not macOS, not iOS.
755+
.. availability:: Unix, not WASI, not macOS, not iOS.
738756

739757
.. versionadded:: 3.2
740758

759+
.. versionchanged:: 3.16
760+
Support for Android now exists.
761+
741762

742763
.. function:: setreuid(ruid, euid, /)
743764

744765
Set the current process's real and effective user ids.
745766

746-
.. availability:: Unix, not WASI, not Android.
767+
.. availability:: Unix, not WASI.
768+
769+
.. versionchanged:: 3.16
770+
Support for Android now exists.
747771

748772

749773
.. function:: getsid(pid, /)
@@ -766,7 +790,10 @@ process and user.
766790

767791
Set the current process's user id.
768792

769-
.. availability:: Unix, not WASI, not Android.
793+
.. availability:: Unix, not WASI.
794+
795+
.. versionchanged:: 3.16
796+
Support for Android now exists.
770797

771798

772799
.. placed in this section since it relates to errno.... a little weak
@@ -2324,11 +2351,14 @@ features:
23242351

23252352
Change the root directory of the current process to *path*.
23262353

2327-
.. availability:: Unix, not WASI, not Android.
2354+
.. availability:: Unix, not WASI.
23282355

23292356
.. versionchanged:: 3.6
23302357
Accepts a :term:`path-like object`.
23312358

2359+
.. versionchanged:: 3.16
2360+
Support for Android now exists.
2361+
23322362

23332363
.. function:: fchdir(fd)
23342364

Doc/library/socket.rst

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1372,10 +1372,13 @@ The :mod:`!socket` module also offers various network-related services:
13721372

13731373
.. audit-event:: socket.sethostname name socket.sethostname
13741374

1375-
.. availability:: Unix, not Android.
1375+
.. availability:: Unix.
13761376

13771377
.. versionadded:: 3.3
13781378

1379+
.. versionchanged:: 3.16
1380+
Support for Android now exists.
1381+
13791382

13801383
.. function:: if_nameindex()
13811384

Doc/using/configure.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1342,6 +1342,16 @@ See :source:`Platforms/Apple/iOS/README.md`.
13421342

13431343
Specify the name for the framework (default: ``Python``).
13441344

1345+
An iOS build configured without ``--enable-framework`` produces a static
1346+
``libpython``, for embedding directly in an app binary. Such a build cannot
1347+
load extension modules at runtime, and so does not support binary wheels; it
1348+
requires ``MODULE_BUILDTYPE=static`` and :option:`--disable-test-modules`, and
1349+
rejects :option:`--enable-shared`. See
1350+
:source:`Platforms/Apple/iOS/README.md` for the full list of limitations.
1351+
1352+
.. versionadded:: 3.16
1353+
iOS builds may be configured without a framework.
1354+
13451355

13461356
Cross Compiling Options
13471357
-----------------------

Doc/using/ios.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,13 @@ should ensure these stub binaries are on your path.
142142
Installing Python on iOS
143143
========================
144144

145+
The official iOS release artefact is a framework build, distributed as an
146+
``XCFramework``; this is the configuration described in the rest of this
147+
document, and the only one that supports binary extension modules. Static
148+
builds, where ``libpython`` and every extension module are linked directly into
149+
the app binary, are also possible, with limitations; see
150+
:source:`Platforms/Apple/iOS/README.md` for details.
151+
145152
Tools for building iOS apps
146153
---------------------------
147154

Doc/whatsnew/3.16.rst

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -474,6 +474,14 @@ os
474474
process via a pidfd. Available on Linux 5.6+.
475475
(Contributed by Maurycy Pawłowski-Wieroński in :gh:`149464`.)
476476

477+
* The following functions are now available on Android:
478+
:func:`os.chroot`, :func:`os.initgroups`, :func:`os.setegid`,
479+
:func:`os.seteuid`, :func:`os.setgid`, :func:`os.setregid`,
480+
:func:`os.setresgid`, :func:`os.setresuid`, :func:`os.setreuid`,
481+
and :func:`os.setuid`. Calling them without sufficient privileges
482+
now raises :exc:`PermissionError` instead of the functions being unavailable.
483+
(Contributed by Md Arif in :gh:`152936`.)
484+
477485

478486
pydoc
479487
-----
@@ -513,6 +521,15 @@ shlex
513521
(Contributed by Jay Berry in :gh:`148846`.)
514522

515523

524+
socket
525+
------
526+
527+
* The :func:`socket.sethostname` function is now available on Android.
528+
Calling it without sufficient privileges now raises :exc:`PermissionError`
529+
instead of the function being unavailable.
530+
(Contributed by Md Arif in :gh:`152936`.)
531+
532+
516533
sqlite3
517534
-------
518535

Include/internal/pycore_fileutils_windows.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,7 @@ static inline BOOL _Py_GetFileInformationByName(
5555
static int GetFileInformationByName_init = -1;
5656

5757
if (GetFileInformationByName_init < 0) {
58-
#ifdef MS_WINDOWS_DESKTOP
5958
HMODULE hMod = LoadLibraryW(L"api-ms-win-core-file-l2-1-4");
60-
#else
61-
HMODULE hMod = LoadPackagedLibrary(L"api-ms-win-core-file-l2-1-4", 0);
62-
#endif
6359
GetFileInformationByName_init = 0;
6460
if (hMod) {
6561
GetFileInformationByName = (PGetFileInformationByName)GetProcAddress(

Include/refcount.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,7 @@ static inline Py_ALWAYS_INLINE void Py_DECREF(PyObject *op)
484484
do { \
485485
_Py_TYPEOF(op)* _tmp_op_ptr = &(op); \
486486
_Py_TYPEOF(op) _tmp_old_op = (*_tmp_op_ptr); \
487-
if (_tmp_old_op != NULL) { \
487+
if (_tmp_old_op != _Py_NULL) { \
488488
*_tmp_op_ptr = _Py_NULL; \
489489
Py_DECREF(_tmp_old_op); \
490490
} \
@@ -494,7 +494,7 @@ static inline Py_ALWAYS_INLINE void Py_DECREF(PyObject *op)
494494
do { \
495495
PyObject **_tmp_op_ptr = _Py_CAST(PyObject**, &(op)); \
496496
PyObject *_tmp_old_op = (*_tmp_op_ptr); \
497-
if (_tmp_old_op != NULL) { \
497+
if (_tmp_old_op != _Py_NULL) { \
498498
PyObject *_null_ptr = _Py_NULL; \
499499
memcpy(_tmp_op_ptr, &_null_ptr, sizeof(PyObject*)); \
500500
Py_DECREF(_tmp_old_op); \

0 commit comments

Comments
 (0)