]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
2 years agogh-104050: Argument clinic: annotate `post_parsing()` and `cleanup()` (#107225)
Alex Waygood [Tue, 25 Jul 2023 22:33:03 +0000 (23:33 +0100)] 
gh-104050: Argument clinic: annotate `post_parsing()` and `cleanup()` (#107225)

2 years agogh-106939: document ShareableList nul-strip quirk. (#107266)
Gregory P. Smith [Tue, 25 Jul 2023 21:09:25 +0000 (14:09 -0700)] 
gh-106939: document ShareableList nul-strip quirk. (#107266)

* gh-106939: document ShareableList nul-strip quirk.
* Mention the `int` size constraint.

2 years agogh-104050: Argument clinic: more misc typing improvements (#107264)
Alex Waygood [Tue, 25 Jul 2023 21:08:52 +0000 (22:08 +0100)] 
gh-104050: Argument clinic: more misc typing improvements (#107264)

2 years agogh-106185: Deduplicate `CPythonTracebackErrorCaretTests` in `test_traceback` (GH...
Nikita Sobolev [Tue, 25 Jul 2023 20:37:47 +0000 (23:37 +0300)] 
gh-106185: Deduplicate `CPythonTracebackErrorCaretTests` in `test_traceback` (GH-106187)

2 years agogh-107082: Fix instruction size computation for ENTER_EXECUTOR (#107256)
Guido van Rossum [Tue, 25 Jul 2023 20:01:02 +0000 (13:01 -0700)] 
gh-107082: Fix instruction size computation for ENTER_EXECUTOR (#107256)

Co-authored-by: Victor Stinner <vstinner@python.org>
2 years agogh-107226: PyModule_AddObjectRef() should only be in the limited API 3.10 (GH-107227)
Serhiy Storchaka [Tue, 25 Jul 2023 19:01:45 +0000 (22:01 +0300)] 
gh-107226: PyModule_AddObjectRef() should only be in the limited API 3.10 (GH-107227)

2 years agogh-106350: Tkinter: do not ignore return value of `mp_init()` (GH-106351)
Christopher Chavez [Tue, 25 Jul 2023 18:52:07 +0000 (13:52 -0500)] 
gh-106350: Tkinter: do not ignore return value of `mp_init()` (GH-106351)

2 years agogh-106004: PyDict_GetItemRef() should only be in the limited API 3.13 (GH-107229)
Serhiy Storchaka [Tue, 25 Jul 2023 18:48:07 +0000 (21:48 +0300)] 
gh-106004: PyDict_GetItemRef() should only be in the limited API 3.13 (GH-107229)

2 years agogh-107249: Implement Py_UNUSED() for MSVC (#107250)
Victor Stinner [Tue, 25 Jul 2023 17:28:16 +0000 (19:28 +0200)] 
gh-107249: Implement Py_UNUSED() for MSVC (#107250)

Fix warnings C4100 in Py_UNUSED() when Python is built with "cl /W4".

Example with this function included by Python.h:

    static inline unsigned int
    PyUnicode_IS_READY(PyObject* Py_UNUSED(op))
    { return 1; }

Without this change, building a C program with "cl /W4" which just
includes Python.h emits the warning:

    Include\cpython/unicodeobject.h(199):
    warning C4100: '_unused_op': unreferenced formal parameter

This change fix this warning.

2 years agogh-106739: Add `rtype_cache` to `warnings.warn` message when leaked objects found...
shailshouryya [Tue, 25 Jul 2023 17:27:36 +0000 (10:27 -0700)] 
gh-106739: Add `rtype_cache` to `warnings.warn` message when leaked objects found (#106740)

Adding the `rtype_cache` to the `warnings.warn` message improves the
previous, somewhat vague message from

```
/Users/username/cpython/Lib/multiprocessing/resource_tracker.py:224: UserWarning: resource_tracker: There appear to be 6 leaked semaphore objects to clean up at shutdown
```

to

```
/Users/username/cpython/Lib/multiprocessing/resource_tracker.py:224: UserWarning: resource_tracker: There appear to be 6 leaked semaphore objects to clean up at shutdown: {'/mp-yor5cvj8', '/mp-10jx8eqr', '/mp-eobsx9tt', '/mp-0lml23vl', '/mp-9dgtsa_m', '/mp-frntyv4s'}
```

---------

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
2 years agoRemove unused internal _PyImport_GetModuleId() function (#107235)
Victor Stinner [Tue, 25 Jul 2023 17:02:12 +0000 (19:02 +0200)] 
Remove unused internal _PyImport_GetModuleId() function (#107235)

2 years agogh-105059: Fix MSCV compiler warning on PyObject union (#107239)
Victor Stinner [Tue, 25 Jul 2023 14:45:38 +0000 (16:45 +0200)] 
gh-105059: Fix MSCV compiler warning on PyObject union (#107239)

Use pragma to ignore the MSCV compiler warning on the PyObject
nameless union.

2 years agogh-106869: Use new PyMemberDef constant names (#106871)
Victor Stinner [Tue, 25 Jul 2023 13:28:30 +0000 (15:28 +0200)] 
gh-106869: Use new PyMemberDef constant names (#106871)

* Remove '#include "structmember.h"'.
* If needed, add <stddef.h> to get offsetof() function.
* Update Parser/asdl_c.py to regenerate Python/Python-ast.c.
* Replace:

  * T_SHORT => Py_T_SHORT
  * T_INT => Py_T_INT
  * T_LONG => Py_T_LONG
  * T_FLOAT => Py_T_FLOAT
  * T_DOUBLE => Py_T_DOUBLE
  * T_STRING => Py_T_STRING
  * T_OBJECT => _Py_T_OBJECT
  * T_CHAR => Py_T_CHAR
  * T_BYTE => Py_T_BYTE
  * T_UBYTE => Py_T_UBYTE
  * T_USHORT => Py_T_USHORT
  * T_UINT => Py_T_UINT
  * T_ULONG => Py_T_ULONG
  * T_STRING_INPLACE => Py_T_STRING_INPLACE
  * T_BOOL => Py_T_BOOL
  * T_OBJECT_EX => Py_T_OBJECT_EX
  * T_LONGLONG => Py_T_LONGLONG
  * T_ULONGLONG => Py_T_ULONGLONG
  * T_PYSSIZET => Py_T_PYSSIZET
  * T_NONE => _Py_T_NONE
  * READONLY => Py_READONLY
  * PY_AUDIT_READ => Py_AUDIT_READ
  * READ_RESTRICTED => Py_AUDIT_READ
  * PY_WRITE_RESTRICTED => _Py_WRITE_RESTRICTED
  * RESTRICTED => (READ_RESTRICTED | _Py_WRITE_RESTRICTED)

2 years agogh-107237: Fix test_udp_reconnection() of test_logging (#107238)
Victor Stinner [Tue, 25 Jul 2023 13:13:59 +0000 (15:13 +0200)] 
gh-107237: Fix test_udp_reconnection() of test_logging (#107238)

test_logging: Fix test_udp_reconnection() by increasing the timeout
from 100 ms to 5 minutes (LONG_TIMEOUT).

Replace also blocking wait() with wait(LONG_TIMEOUT) in
test_output() to prevent the test to hang.

2 years agogh-105059: Use GCC/clang extension for PyObject union (#107232)
Victor Stinner [Tue, 25 Jul 2023 12:27:48 +0000 (14:27 +0200)] 
gh-105059: Use GCC/clang extension for PyObject union (#107232)

Anonymous union is new in C11. To prevent compiler warning
when using -pedantic compiler option, use Clang and GCC
extension on C99 and older.

2 years agogh-106996: Add a how-to section to the turtle documentation (#107153)
Daniele Procida [Tue, 25 Jul 2023 12:03:57 +0000 (14:03 +0200)] 
gh-106996: Add a how-to section to the turtle documentation (#107153)

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2 years agogh-86493: Modernize modules initialization code (GH-106858)
Serhiy Storchaka [Tue, 25 Jul 2023 11:34:49 +0000 (14:34 +0300)] 
gh-86493: Modernize modules initialization code (GH-106858)

Use PyModule_Add() or PyModule_AddObjectRef() instead of soft deprecated
PyModule_AddObject().

2 years agogh-106774: Update bundled pip version to 23.2.1 (#106775)
Paul Moore [Tue, 25 Jul 2023 09:59:25 +0000 (10:59 +0100)] 
gh-106774: Update bundled pip version to 23.2.1 (#106775)

* Update bundled pip version to 23.2.1

2 years agogh-104050: Argument clinic: more misc typing coverage improvements (#107210)
Alex Waygood [Tue, 25 Jul 2023 08:49:07 +0000 (09:49 +0100)] 
gh-104050: Argument clinic: more misc typing coverage improvements (#107210)

2 years agogh-104050: Argument clinic: improve typing around adding C converters (#107209)
Alex Waygood [Tue, 25 Jul 2023 08:18:19 +0000 (09:18 +0100)] 
gh-104050: Argument clinic: improve typing around adding C converters (#107209)

2 years agogh-107211: No longer export internal variables (#107218)
Victor Stinner [Tue, 25 Jul 2023 03:48:04 +0000 (05:48 +0200)] 
gh-107211: No longer export internal variables (#107218)

No longer export these 5 internal C API variables:

* _PyBufferWrapper_Type
* _PyImport_FrozenBootstrap
* _PyImport_FrozenStdlib
* _PyImport_FrozenTest
* _Py_SwappedOp

Fix the definition of these internal functions, replace PyAPI_DATA()
with PyAPI_FUNC():

* _PyImport_ClearExtension()
* _PyObject_IsFreed()
* _PyThreadState_GetCurrent()

2 years agogh-107211: No longer export internal functions (4) (#107217)
Victor Stinner [Tue, 25 Jul 2023 03:16:28 +0000 (05:16 +0200)] 
gh-107211: No longer export internal functions (4) (#107217)

No longer export these 2 internal C API functions:

* _PyEval_SignalAsyncExc()
* _PyEval_SignalReceived()

Add also comments explaining why some internal functions have to be
exported, and update existing comments.

2 years agogh-107211: No longer export internal functions (3) (#107215)
Victor Stinner [Tue, 25 Jul 2023 02:25:45 +0000 (04:25 +0200)] 
gh-107211: No longer export internal functions (3) (#107215)

No longer export these 14 internal C API functions:

* _PySys_Audit()
* _PySys_SetAttr()
* _PyTraceBack_FromFrame()
* _PyTraceBack_Print_Indented()
* _PyUnicode_FormatAdvancedWriter()
* _PyUnicode_ScanIdentifier()
* _PyWarnings_Init()
* _Py_DumpASCII()
* _Py_DumpDecimal()
* _Py_DumpHexadecimal()
* _Py_DumpTraceback()
* _Py_DumpTracebackThreads()
* _Py_WriteIndent()
* _Py_WriteIndentedMargin()

2 years agogh-107211: No longer export internal functions (2) (#107214)
Victor Stinner [Tue, 25 Jul 2023 01:49:28 +0000 (03:49 +0200)] 
gh-107211: No longer export internal functions (2) (#107214)

No longer export these 43 internal C API functions:

* _PyDict_CheckConsistency()
* _PyErr_ChainStackItem()
* _PyErr_CheckSignals()
* _PyErr_CheckSignalsTstate()
* _PyErr_Clear()
* _PyErr_ExceptionMatches()
* _PyErr_Fetch()
* _PyErr_Format()
* _PyErr_FormatFromCauseTstate()
* _PyErr_GetExcInfo()
* _PyErr_GetHandledException()
* _PyErr_GetTopmostException()
* _PyErr_NoMemory()
* _PyErr_NormalizeException()
* _PyErr_Restore()
* _PyErr_SetHandledException()
* _PyErr_SetNone()
* _PyErr_SetObject()
* _PyErr_SetString()
* _PyErr_StackItemToExcInfoTuple()
* _PyExc_CreateExceptionGroup()
* _PyExc_PrepReraiseStar()
* _PyException_AddNote()
* _PyInterpreterState_Enable()
* _PyLong_FormatAdvancedWriter()
* _PyLong_FormatBytesWriter()
* _PyLong_FormatWriter()
* _PyMem_GetAllocatorName()
* _PyMem_SetDefaultAllocator()
* _PyMem_SetupAllocators()
* _PyOS_InterruptOccurred()
* _PyRuntimeState_Fini()
* _PyRuntimeState_Init()
* _PyRuntime_Finalize()
* _PyRuntime_Initialize()
* _PyThreadState_Bind()
* _PyThreadState_DeleteExcept()
* _PyThreadState_New()
* _PyThreadState_Swap()
* _PyType_CheckConsistency()
* _PyUnicodeTranslateError_Create()
* _Py_DumpExtensionModules()
* _Py_FatalErrorFormat()

2 years agogh-107211: No longer export internal functions (1) (#107213)
Victor Stinner [Tue, 25 Jul 2023 01:44:11 +0000 (03:44 +0200)] 
gh-107211: No longer export internal functions (1) (#107213)

No longer export these 49 internal C API functions:

* _PyArgv_AsWstrList()
* _PyCode_New()
* _PyCode_Validate()
* _PyFloat_DebugMallocStats()
* _PyFloat_FormatAdvancedWriter()
* _PyImport_CheckSubinterpIncompatibleExtensionAllowed()
* _PyImport_ClearExtension()
* _PyImport_GetModuleId()
* _PyImport_SetModuleString()
* _PyInterpreterState_IDDecref()
* _PyInterpreterState_IDIncref()
* _PyInterpreterState_IDInitref()
* _PyInterpreterState_LookUpID()
* _PyWideStringList_AsList()
* _PyWideStringList_CheckConsistency()
* _PyWideStringList_Clear()
* _PyWideStringList_Copy()
* _PyWideStringList_Extend()
* _Py_ClearArgcArgv()
* _Py_DecodeUTF8Ex()
* _Py_DecodeUTF8_surrogateescape()
* _Py_EncodeLocaleRaw()
* _Py_EncodeUTF8Ex()
* _Py_GetEnv()
* _Py_GetForceASCII()
* _Py_GetLocaleEncoding()
* _Py_GetLocaleEncodingObject()
* _Py_GetLocaleconvNumeric()
* _Py_ResetForceASCII()
* _Py_device_encoding()
* _Py_dg_dtoa()
* _Py_dg_freedtoa()
* _Py_dg_strtod()
* _Py_get_blocking()
* _Py_get_env_flag()
* _Py_get_inheritable()
* _Py_get_osfhandle_noraise()
* _Py_get_xoption()
* _Py_open()
* _Py_open_osfhandle()
* _Py_open_osfhandle_noraise()
* _Py_read()
* _Py_set_blocking()
* _Py_str_to_int()
* _Py_wfopen()
* _Py_wgetcwd()
* _Py_wreadlink()
* _Py_wrealpath()
* _Py_write()

2 years agogh-107211: Rename PySymtable_Lookup() to _PySymtable_Lookup() (#107212)
Victor Stinner [Tue, 25 Jul 2023 00:54:09 +0000 (02:54 +0200)] 
gh-107211: Rename PySymtable_Lookup() to _PySymtable_Lookup() (#107212)

Rename the internal PySymtable_Lookup() function to
_PySymtable_Lookup() and no longer export it.

2 years agogh-104050: Argument Clinic: Annotate `CRenderData.__init__` (#107207)
Alex Waygood [Mon, 24 Jul 2023 21:38:50 +0000 (22:38 +0100)] 
gh-104050: Argument Clinic: Annotate `CRenderData.__init__` (#107207)

Argument Clinic: Annotate `CRenderData.__init__`

2 years agogh-104050: Argument clinic: misc improvements to type annotation coverage (#107206)
Alex Waygood [Mon, 24 Jul 2023 21:23:58 +0000 (22:23 +0100)] 
gh-104050: Argument clinic: misc improvements to type annotation coverage (#107206)

2 years agogh-106149: move _PyCfg_BasicblockLastInstr and make it local to flowgraph.c (#107180)
Irit Katriel [Mon, 24 Jul 2023 21:08:59 +0000 (22:08 +0100)] 
gh-106149: move _PyCfg_BasicblockLastInstr and make it local to flowgraph.c (#107180)

2 years agogh-104050: Argument clinic: annotate `format_docstring()` (#107200)
Alex Waygood [Mon, 24 Jul 2023 20:29:50 +0000 (21:29 +0100)] 
gh-104050: Argument clinic: annotate `format_docstring()` (#107200)

2 years agogh-106917: fix super classmethod calls to non-classmethods (#106977)
Carl Meyer [Mon, 24 Jul 2023 20:14:56 +0000 (14:14 -0600)] 
gh-106917: fix super classmethod calls to non-classmethods (#106977)

2 years agogh-106727: Add `__module__` check for `inspect.getsource(cls)` (#106968)
Tian Gao [Mon, 24 Jul 2023 20:12:45 +0000 (12:12 -0800)] 
gh-106727: Add `__module__` check for `inspect.getsource(cls)` (#106968)

2 years agogh-102304: Rename _Py_IncRefTotal_DO_NOT_USE_THIS() (#107193)
Victor Stinner [Mon, 24 Jul 2023 19:47:50 +0000 (21:47 +0200)] 
gh-102304: Rename _Py_IncRefTotal_DO_NOT_USE_THIS() (#107193)

* Rename _Py_IncRefTotal_DO_NOT_USE_THIS() to _Py_INCREF_IncRefTotal()
* Rename _Py_DecRefTotal_DO_NOT_USE_THIS() to _Py_DECREF_DecRefTotal()
* Remove temporary _Py_INC_REFTOTAL() and _Py_DEC_REFTOTAL() macros

2 years agogh-98608: Move PyInterpreterConfig to pylifecycle.h (#107191)
Victor Stinner [Mon, 24 Jul 2023 19:42:04 +0000 (21:42 +0200)] 
gh-98608: Move PyInterpreterConfig to pylifecycle.h (#107191)

Move PyInterpreterConfig structure and associated macros from
initconfig.h to pylifecycle.h: it's not related to the Python
Initialization Configuration.

2 years agogh-104050: Argument Clinic: annotate `main()` (#107192)
Alex Waygood [Mon, 24 Jul 2023 19:32:38 +0000 (20:32 +0100)] 
gh-104050: Argument Clinic: annotate `main()` (#107192)

2 years agoGH-96803: Move PyUnstable_InterpreterFrame_GetCode() to Python.h (#107188)
Victor Stinner [Mon, 24 Jul 2023 19:20:44 +0000 (21:20 +0200)] 
GH-96803: Move PyUnstable_InterpreterFrame_GetCode() to Python.h (#107188)

Declare the following 3 PyUnstable functions in
Include/cpython/pyframe.h rather than Include/cpython/frameobject.h,
so they are now provided by the standard "#include <Python.h>".

2 years agogh-106368: Increase Argument Clinic CLI test coverage (#107156)
Erlend E. Aasland [Mon, 24 Jul 2023 18:49:16 +0000 (20:49 +0200)] 
gh-106368: Increase Argument Clinic CLI test coverage (#107156)

Instead of hacking into the Clinic class, use the Argument Clinic tool
to run the ClinicExternalTest test suite.

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2 years agogh-106320: Remove private _PyMem API (#107187)
Victor Stinner [Mon, 24 Jul 2023 18:48:06 +0000 (20:48 +0200)] 
gh-106320: Remove private _PyMem API (#107187)

Move private _PyMem functions to the internal C API (pycore_pymem.h):

* _PyMem_GetCurrentAllocatorName()
* _PyMem_RawStrdup()
* _PyMem_RawWcsdup()
* _PyMem_Strdup()

No longer export these functions.

Move pymem_getallocatorsname() function from _testcapi to _testinternalcapi,
since the API moved to the internal C API.

2 years agogh-106320: Remove private _PyUnicode C API (#107185)
Victor Stinner [Mon, 24 Jul 2023 18:26:29 +0000 (20:26 +0200)] 
gh-106320: Remove private _PyUnicode C API (#107185)

Move private _PyUnicode functions to the internal C API
(pycore_unicodeobject.h):

* _PyUnicode_IsCaseIgnorable()
* _PyUnicode_IsCased()
* _PyUnicode_IsXidContinue()
* _PyUnicode_IsXidStart()
* _PyUnicode_ToFoldedFull()
* _PyUnicode_ToLowerFull()
* _PyUnicode_ToTitleFull()
* _PyUnicode_ToUpperFull()

No longer export these functions.

2 years agoThoroughly refactor the cases generator (#107151)
Guido van Rossum [Mon, 24 Jul 2023 16:38:23 +0000 (09:38 -0700)] 
Thoroughly refactor the cases generator (#107151)

This mostly extracts a whole bunch of stuff out of generate_cases.py into separate files, but there are a few other things going on here.

- analysis.py: `Analyzer` etc.
- instructions.py: `Instruction` etc.
- flags.py: `InstructionFlags`, `variable_used`, `variable_used_unspecialized`
- formatting.py: `Formatter` etc.
- Rename parser.py to parsing.py, to avoid conflict with stdlib parser.py
- Blackify most things
- Fix most mypy errors
- Remove output filenames from Generator state, add them to `write_instructions()` etc.
- Fix unit tests

2 years agoDocs: Add missing markup to Argument Clinic docs (#106876)
Erlend E. Aasland [Mon, 24 Jul 2023 15:22:18 +0000 (17:22 +0200)] 
Docs: Add missing markup to Argument Clinic docs (#106876)

Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2 years agogh-107162: Document errcode.h usage in its comment (#107177)
Victor Stinner [Mon, 24 Jul 2023 14:14:58 +0000 (16:14 +0200)] 
gh-107162: Document errcode.h usage in its comment (#107177)

Public and documented PyRun_InteractiveOneFlags() C API uses it.

2 years agogh-106320: Remove private _PyDict C API (#107145)
Victor Stinner [Mon, 24 Jul 2023 14:02:03 +0000 (16:02 +0200)] 
gh-106320: Remove private _PyDict C API (#107145)

Move private _PyDict functions to the internal C API (pycore_dict.h):

* _PyDict_Contains_KnownHash()
* _PyDict_DebugMallocStats()
* _PyDict_DelItemIf()
* _PyDict_GetItemWithError()
* _PyDict_HasOnlyStringKeys()
* _PyDict_MaybeUntrack()
* _PyDict_MergeEx()

No longer export these functions.

2 years agoFix PyVectorcall_Function doc versionadded (#107140)
da-woods [Mon, 24 Jul 2023 12:54:38 +0000 (13:54 +0100)] 
Fix PyVectorcall_Function doc versionadded (#107140)

The documentation implies that PyVectorcall_Function() was available in Python 3.8.
This is half-true - it was available under a different name. I think it's clearer to set
the "version added" to 3.9.

2 years agoDocs: Remove duplicate word in Argument Clinic howto heading (#107169)
Hakan Celik [Mon, 24 Jul 2023 11:54:39 +0000 (14:54 +0300)] 
Docs: Remove duplicate word in Argument Clinic howto heading (#107169)

2 years agogh-107017: Change Chapter Strings to Texts in the Introduction chapter. (#107104)
TommyUnreal [Mon, 24 Jul 2023 05:55:57 +0000 (07:55 +0200)] 
gh-107017: Change Chapter Strings to Texts in the Introduction chapter. (#107104)

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2 years agogh-106320: Remove private _PyObject C API (#107159)
Victor Stinner [Sun, 23 Jul 2023 22:25:48 +0000 (00:25 +0200)] 
gh-106320: Remove private _PyObject C API (#107159)

Move private _PyObject and private _PyType functions to the internal
C API (pycore_object.h):

* _PyObject_GetMethod()
* _PyObject_IsAbstract()
* _PyObject_NextNotImplemented()
* _PyType_CalculateMetaclass()
* _PyType_GetDocFromInternalDoc()
* _PyType_GetTextSignatureFromInternalDoc()

No longer export these functions.

2 years agoDocs: fix typo in os.pwrite docstring (#107087)
Jérôme Carretero [Sun, 23 Jul 2023 21:53:25 +0000 (17:53 -0400)] 
Docs: fix typo in os.pwrite docstring (#107087)

2 years agogh-105291: Add link to migration guide for distutils (#107130)
cLupus [Sun, 23 Jul 2023 21:50:01 +0000 (23:50 +0200)] 
gh-105291: Add link to migration guide for distutils (#107130)

Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
2 years agogh-106948: Docs: Disable links for C standard library functions, OS utility functions...
Erlend E. Aasland [Sun, 23 Jul 2023 20:56:56 +0000 (22:56 +0200)] 
gh-106948: Docs: Disable links for C standard library functions, OS utility functions and system calls (#107062)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2 years agogh-106320: Remove _PyBytes_Join() C API (#107144)
Victor Stinner [Sun, 23 Jul 2023 20:10:12 +0000 (22:10 +0200)] 
gh-106320: Remove _PyBytes_Join() C API (#107144)

Move private _PyBytes functions to the internal C API
(pycore_bytesobject.h):

* _PyBytes_DecodeEscape()
* _PyBytes_FormatEx()
* _PyBytes_FromHex()
* _PyBytes_Join()

No longer export these functions.

2 years agogh-106320: Remove private _PyObject C API (#107147)
Victor Stinner [Sun, 23 Jul 2023 20:09:08 +0000 (22:09 +0200)] 
gh-106320: Remove private _PyObject C API (#107147)

Move private debug _PyObject functions to the internal C API
(pycore_object.h):

* _PyDebugAllocatorStats()
* _PyObject_CheckConsistency()
* _PyObject_DebugTypeStats()
* _PyObject_IsFreed()

No longer export most of these functions, except of
_PyObject_IsFreed().

Move test functions using _PyObject_IsFreed() from _testcapi to
_testinternalcapi. check_pyobject_is_freed() test no longer catch
_testcapi.error: the tested function cannot raise _testcapi.error.

2 years agogh-106320: Remove _PyTuple_MaybeUntrack() C API (#107143)
Victor Stinner [Sun, 23 Jul 2023 19:16:21 +0000 (21:16 +0200)] 
gh-106320: Remove _PyTuple_MaybeUntrack() C API (#107143)

Move _PyTuple_MaybeUntrack() and _PyTuple_DebugMallocStats() functions
to the internal C API (pycore_tuple.h). No longer export these functions.

2 years agogh-106320: Remove _PyIsSelectable_fd() C API (#107142)
Victor Stinner [Sun, 23 Jul 2023 19:07:12 +0000 (21:07 +0200)] 
gh-106320: Remove _PyIsSelectable_fd() C API (#107142)

Move _PyIsSelectable_fd() macro to the internal C API
(pycore_fileutils.h).

2 years agoRemove superflous whitespaces in `layout.html`. (GH-107067)
Ezio Melotti [Sun, 23 Jul 2023 15:18:50 +0000 (17:18 +0200)] 
Remove superflous whitespaces in `layout.html`. (GH-107067)

2 years agogh-107122: Update what's news for dbm.*dbm.clear() method (gh-107135)
Dong-hee Na [Sun, 23 Jul 2023 15:08:50 +0000 (00:08 +0900)] 
gh-107122: Update what's news for dbm.*dbm.clear() method (gh-107135)

2 years agogh-107122: Add clear method to dbm.ndbm module (gh-107126)
Dong-hee Na [Sun, 23 Jul 2023 14:26:23 +0000 (23:26 +0900)] 
gh-107122: Add clear method to dbm.ndbm module (gh-107126)

2 years agogh-62519: Make pgettext search plurals when translation is not found (#107118)
Tomas R [Sun, 23 Jul 2023 14:08:28 +0000 (16:08 +0200)] 
gh-62519: Make pgettext search plurals when translation is not found (#107118)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2 years agogh-107122: Add clear method to dbm.gdbm.module (gh-107127)
Dong-hee Na [Sun, 23 Jul 2023 13:51:12 +0000 (22:51 +0900)] 
gh-107122: Add clear method to dbm.gdbm.module (gh-107127)

2 years agogh-107017: Analolgy to Pascal and C replaced. (#107025)
TommyUnreal [Sun, 23 Jul 2023 12:07:24 +0000 (14:07 +0200)] 
gh-107017: Analolgy to Pascal and C replaced. (#107025)

Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
2 years agogh-107091: Fix the use of some C domain roles (#107092)
Serhiy Storchaka [Sun, 23 Jul 2023 10:27:05 +0000 (13:27 +0300)] 
gh-107091: Fix the use of some C domain roles (#107092)

2 years agogh-106186: Don't report MultipartInvariantViolationDefect for valid multipart emails...
htsedebenham [Sun, 23 Jul 2023 10:25:18 +0000 (11:25 +0100)] 
gh-106186: Don't report MultipartInvariantViolationDefect for valid multipart emails when parsing header only (#107016)

2 years agobpo-18319: gettext() can retrieve a message even if a plural form exists (#19869)
Gilles Bassière [Sun, 23 Jul 2023 09:59:19 +0000 (11:59 +0200)] 
bpo-18319: gettext() can retrieve a message even if a plural form exists (#19869)

2 years agogh-106996: Add the basics of a turtle graphics tutorial (#107072)
Daniele Procida [Sun, 23 Jul 2023 09:43:27 +0000 (11:43 +0200)] 
gh-106996: Add the basics of a turtle graphics tutorial (#107072)

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2 years agogh-106976: alphabetise bullets by module name task2-3 (#107005)
littlebutt's workshop [Sun, 23 Jul 2023 09:41:34 +0000 (09:41 +0000)] 
gh-106976: alphabetise bullets by module name task2-3 (#107005)

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2 years agogh-101100: Fix some broken sphinx references (#107095)
wulmer [Sun, 23 Jul 2023 09:23:44 +0000 (11:23 +0200)] 
gh-101100: Fix some broken sphinx references (#107095)

2 years agogh-54738: Add argparse i18n howto (#104562)
Tomas R [Sun, 23 Jul 2023 09:10:38 +0000 (11:10 +0200)] 
gh-54738: Add argparse i18n howto (#104562)

2 years agogh-71261: Add paragraph on shadowing submodules with star imports (#107004)
wulmer [Sun, 23 Jul 2023 09:00:42 +0000 (11:00 +0200)] 
gh-71261: Add paragraph on shadowing submodules with star imports (#107004)

2 years agogh-107017: removed mention that C does it the same way (#107020)
Jakub Červinka [Sun, 23 Jul 2023 08:57:52 +0000 (10:57 +0200)] 
gh-107017: removed mention that C does it the same way (#107020)

2 years agogh-102111: Add link to string escape sequences in re module (#106995)
wulmer [Sun, 23 Jul 2023 08:50:38 +0000 (10:50 +0200)] 
gh-102111: Add link to string escape sequences in re module (#106995)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2 years agogh-82500: Fix asyncio sendfile overflow on 32bit (#107056)
J. Nick Koston [Sun, 23 Jul 2023 04:07:14 +0000 (23:07 -0500)] 
gh-82500: Fix asyncio sendfile overflow on 32bit (#107056)

2 years agogh-107082: Remove debug hack from get_first_executor in test_capi.test_misc (#107085)
Guido van Rossum [Sun, 23 Jul 2023 01:22:33 +0000 (18:22 -0700)] 
gh-107082: Remove debug hack from get_first_executor in test_capi.test_misc (#107085)

(Even though it doesn't look like it fixes gh-107082 -- see discussion there -- it still removes debug code that should never have been committed.)

2 years agogh-106962: Detect mpicc in configure.ac (#106961)
Lukas van de Wiel [Sat, 22 Jul 2023 23:20:03 +0000 (01:20 +0200)] 
gh-106962: Detect mpicc in configure.ac (#106961)

Don't let autoconf mistake MPI compilers for Intel compilers;
filter out the MPI case to prevent Intel specific options from being applied.

2 years agogh-104050: Argument Clinic: Increase typing coverage (#107074)
Erlend E. Aasland [Sat, 22 Jul 2023 22:30:42 +0000 (00:30 +0200)] 
gh-104050: Argument Clinic: Increase typing coverage (#107074)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2 years agogh-106320: Remove _PyFunction_Vectorcall() API (#107071)
Victor Stinner [Sat, 22 Jul 2023 21:44:33 +0000 (23:44 +0200)] 
gh-106320: Remove _PyFunction_Vectorcall() API (#107071)

Move _PyFunction_Vectorcall() API to the internal C API.
No longer export the function.

2 years agogh-106320: Remove private _PyModule API (#107070)
Victor Stinner [Sat, 22 Jul 2023 21:41:11 +0000 (23:41 +0200)] 
gh-106320: Remove private _PyModule API (#107070)

Move private _PyModule API to the internal C API
(pycore_moduleobject.h):

* _PyModule_Clear()
* _PyModule_ClearDict()
* _PyModuleSpec_IsInitializing()
* _PyModule_IsExtension()

No longer export these functions.

2 years agoGH-103082: Rename PY_MONITORING_EVENTS to _PY_MONITORING_EVENTS (#107069)
Victor Stinner [Sat, 22 Jul 2023 21:35:27 +0000 (23:35 +0200)] 
GH-103082: Rename PY_MONITORING_EVENTS to _PY_MONITORING_EVENTS (#107069)

Rename private C API constants:

* Rename PY_MONITORING_UNGROUPED_EVENTS to _PY_MONITORING_UNGROUPED_EVENTS
* Rename PY_MONITORING_EVENTS to _PY_MONITORING_EVENTS

2 years agogh-106527: asyncio: optimize to add/remove readers and writers (#106528)
J. Nick Koston [Sat, 22 Jul 2023 21:07:40 +0000 (16:07 -0500)] 
gh-106527: asyncio: optimize to add/remove readers and writers (#106528)

2 years agogh-106320: Move _PyMethodWrapper_Type to internal C API (#107064)
Victor Stinner [Sat, 22 Jul 2023 20:57:59 +0000 (22:57 +0200)] 
gh-106320: Move _PyMethodWrapper_Type to internal C API (#107064)

2 years agogh-107028: tiny textual changes in logging docs and docstrings (GH-107029)
Jochem Boersma [Sat, 22 Jul 2023 20:43:18 +0000 (22:43 +0200)] 
gh-107028: tiny textual changes in logging docs and docstrings (GH-107029)

2 years agogh-106320: Remove private _PyInterpreterID C API (#107053)
Victor Stinner [Sat, 22 Jul 2023 19:31:55 +0000 (21:31 +0200)] 
gh-106320: Remove private _PyInterpreterID C API (#107053)

Move the private _PyInterpreterID C API to the internal C API: add a
new pycore_interp_id.h header file.

Remove Include/interpreteridobject.h and
Include/cpython/interpreteridobject.h header files.

2 years agogh-106948: Add standard external names to nitpick_ignore (GH-106949)
Serhiy Storchaka [Sat, 22 Jul 2023 18:35:22 +0000 (21:35 +0300)] 
gh-106948: Add standard external names to nitpick_ignore (GH-106949)

It includes standard C types, macros and variables like "size_t",
"LONG_MAX" and "errno", and standard environment variables like "PATH".

2 years agogh-107008: Document the curses module variables LINES and COLS (GH-107011)
Serhiy Storchaka [Sat, 22 Jul 2023 16:54:50 +0000 (19:54 +0300)] 
gh-107008: Document the curses module variables LINES and COLS (GH-107011)

LINES and COLS referred in curses.update_lines_cols() documentations are
the module variables, not the environment variables.

2 years agogh-106320: Remove _Py_SwappedOp from the C API (#107036)
Victor Stinner [Sat, 22 Jul 2023 16:07:07 +0000 (18:07 +0200)] 
gh-106320: Remove _Py_SwappedOp from the C API (#107036)

Move _Py_SwappedOp to the internal C API (pycore_object.h).

2 years agogh-75371: reformat Makefile.pre.in to accommodate for empty FRAMEWORKALTINSTALLLAST...
Moritz Neeb [Sat, 22 Jul 2023 15:59:11 +0000 (17:59 +0200)] 
gh-75371: reformat Makefile.pre.in to accommodate for empty FRAMEWORKALTINSTALLLAST (#107035)

in the case of an empty FRAMEWORKALTINSTALLLAST, this patch prevents leaving
an astray linebreak and two tabs in the resulting Makefile.

Before change:
```
.PHONY: commoninstall
commoninstall:  check-clean-src  \
altbininstall libinstall inclinstall libainstall \
sharedinstall altmaninstall \

```

After change (with empty FRAMEWORKALTINSTALLLAST):
```
.PHONY: commoninstall
commoninstall:  check-clean-src  \
altbininstall libinstall inclinstall libainstall \
sharedinstall altmaninstall
```

2 years agogh-83006: Document behavior of `shutil.disk_usage` for non-mounted filesystems on...
Matthieu Caneill [Sat, 22 Jul 2023 15:58:06 +0000 (17:58 +0200)] 
gh-83006: Document behavior of `shutil.disk_usage` for non-mounted filesystems on Unix (#107031)

2 years agoFix Sphinx warnings in `re` module docs (#107044)
wulmer [Sat, 22 Jul 2023 15:44:44 +0000 (17:44 +0200)] 
Fix Sphinx warnings in `re` module docs (#107044)

2 years agogh-106320: Move private _PySet API to the internal API (#107041)
Victor Stinner [Sat, 22 Jul 2023 15:04:34 +0000 (17:04 +0200)] 
gh-106320: Move private _PySet API to the internal API (#107041)

* Add pycore_setobject.h header file.
* Move the following API to the internal C API:

  * _PySet_Dummy
  * _PySet_NextEntry()
  * _PySet_Update()

2 years agogh-106967: remove Release and Date fields from whatsnew for 3.12 and 3.13 (#107000)
Oliver Rew [Sat, 22 Jul 2023 14:57:51 +0000 (16:57 +0200)] 
gh-106967: remove Release and Date fields from whatsnew for 3.12 and 3.13 (#107000)

2 years agogh-65495: Use lowercase `mail from` and `rcpt to` in `smtplib.SMTP` (#107019)
Matthieu Caneill [Sat, 22 Jul 2023 14:46:59 +0000 (16:46 +0200)] 
gh-65495: Use lowercase `mail from` and `rcpt to` in `smtplib.SMTP` (#107019)

Use lowercase `mail from` and `rcpt to` in `smtplib.SMTP`

SMTP commands are case-insensitive. `smtplib` uses lowercase commands,
however it writes `mail FROM` and `rcpt TO`, lacking consistency.

2 years agogh-106320: Remove _PyOS_ReadlineTState API (#107034)
Victor Stinner [Sat, 22 Jul 2023 14:45:56 +0000 (16:45 +0200)] 
gh-106320: Remove _PyOS_ReadlineTState API (#107034)

Remove _PyOS_ReadlineTState variable from the public C API.
The symbol is still exported for the readline shared extension.

2 years agogh-105090: Replace incorrect TLSv1.2 with TLSv1.3 (#105404)
Jocelyn Castellano [Sat, 22 Jul 2023 14:29:08 +0000 (10:29 -0400)] 
gh-105090: Replace incorrect TLSv1.2 with TLSv1.3 (#105404)

2 years agogh-106320: Move private _PyGen API to the internal C API (#107032)
Victor Stinner [Sat, 22 Jul 2023 14:21:16 +0000 (16:21 +0200)] 
gh-106320: Move private _PyGen API to the internal C API (#107032)

Move private _PyGen API to internal C API:

* _PyAsyncGenAThrow_Type
* _PyAsyncGenWrappedValue_Type
* _PyCoroWrapper_Type
* _PyGen_FetchStopIterationValue()
* _PyGen_Finalize()
* _PyGen_SetStopIterationValue()

No longer these symbols, except of the ones by the _asyncio shared
extensions.

2 years agogh-106320: Move _PyNone_Type to the internal C API (#107030)
Victor Stinner [Sat, 22 Jul 2023 14:12:17 +0000 (16:12 +0200)] 
gh-106320: Move _PyNone_Type to the internal C API (#107030)

Move private types _PyNone_Type and _PyNotImplemented_Type to
internal C API.

2 years agogh-106320: Move private _PyHash API to the internal C API (#107026)
Victor Stinner [Sat, 22 Jul 2023 13:49:37 +0000 (15:49 +0200)] 
gh-106320: Move private _PyHash API to the internal C API (#107026)

* No longer export most private _PyHash symbols, only export the ones
  which are needed by shared extensions.
* Modules/_xxtestfuzz/fuzzer.c now uses the internal C API.

2 years agogh-106320: Document private C API removal in What's New 3.13 (#107027)
Victor Stinner [Sat, 22 Jul 2023 13:30:13 +0000 (15:30 +0200)] 
gh-106320: Document private C API removal in What's New 3.13 (#107027)

2 years agogh-69714: Make `calendar` module fully tested (#93655)
Bart Skowron [Sat, 22 Jul 2023 13:20:40 +0000 (15:20 +0200)] 
gh-69714: Make `calendar` module fully tested (#93655)

There are 3 paths to use `locale` argument in
`calendar.Locale{Text|HTML}Calendar.__init__(..., locale=None)`:
(1) `locale=None` -- denotes the "default locale"[1]
(2) `locale=""` -- denotes the native environment
(3) `locale=other_valid_locale` -- denotes a custom locale

So far case (2) is covered and case (1) is in 78935daf5a (same branch).
This commit adds a remaining case (3).

[1] In the current implementation, this translates into the following
approach:

GET current locale
IF current locale == "C" THEN
  SET current locale TO ""
  GET current locale
ENDIF

* Remove unreachable code (and increase test coverage)

This condition cannot be true. `_locale.setlocale()` from the C module
raises `locale.Error` instead of returning `None` for
`different_locale.__enter__` (where `self.oldlocale` is set).

* Expand the try clause to calls to `LocaleTextCalendar.formatmonthname()`.

This method temporarily changes the current locale to the given locale,
so `_locale.setlocale()` may raise `local.Error`.

Co-authored-by: Rohit Mediratta <rohitm@gmail.com>
Co-authored-by: Jessica McKellar <jesstess@mit.edu>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
2 years agogh-106320: Remove private _PyUnicode_AsString() alias (#107021)
Victor Stinner [Sat, 22 Jul 2023 13:15:05 +0000 (15:15 +0200)] 
gh-106320: Remove private _PyUnicode_AsString() alias (#107021)

Remove private _PyUnicode_AsString() alias to PyUnicode_AsUTF8(). It
was kept for backward compatibility with Python 3.0 - 3.2.

The PyUnicode_AsUTF8() is available since Python
3.3. The PyUnicode_AsUTF8String() function can be used to keep
compatibility with Python 3.2 and older.

2 years agogh-106989: Remove tok report warnings (#106993)
Menelaos Kotoglou [Sat, 22 Jul 2023 12:23:23 +0000 (15:23 +0300)] 
gh-106989: Remove tok report warnings (#106993)

2 years agogh-105699: Add some stress tests for subinterpreter creation (#106966)
Eric Snow [Sat, 22 Jul 2023 12:21:55 +0000 (06:21 -0600)] 
gh-105699: Add some stress tests for subinterpreter creation (#106966)