Commit Graph

117619 Commits

Author SHA1 Message Date
Inada Naoki a3dd8cce58
gh-106162: fix test_array modifies warning filter (#106181) 2023-06-28 16:50:36 +09:00
lightdrk 541a10f9ed
Refer to `TimeoutError` instead of `asyncio.TimeoutError` in `asyncio-task.rst` (#106136)
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2023-06-27 23:21:38 -06:00
Victor Stinner 1f74b9e933
Fix c-analyzer for GCC: ignore LANG env var (#106173)
The c-analyzer doesn't support GCC localized messages, so just unset
the LANG environment variable.
2023-06-28 02:50:51 +00:00
Victor Stinner adaacf26d3
GH-104584: Fix test_capi.test_counter_optimizer() when run twice (#106171)
test_counter_optimizer() and test_long_loop() of test_capi now create
a new function at each call. Otherwise, the optimizer counters are
not the expected values when the test is run more than once.
2023-06-28 04:41:21 +02:00
Victor Stinner 2ac3eec103
gh-101634: regrtest reports decoding error as failed test (#106169)
When running the Python test suite with -jN option, if a worker stdout
cannot be decoded from the locale encoding report a failed testn so the
exitcode is non-zero.
2023-06-28 04:26:52 +02:00
Victor Stinner 3f8483cad2
gh-106168: PyTuple_SET_ITEM() now checks the index (#106164)
PyTuple_SET_ITEM() and PyList_SET_ITEM() now check the index argument
with an assertion if Python is built in debug mode or is built with
assertions.

* list_extend() and _PyList_AppendTakeRef() now set the list size
  before calling PyList_SET_ITEM().
* PyStructSequence_GetItem() and PyStructSequence_SetItem() now check
  the index argument: must be lesser than REAL_SIZE(op).
* PyStructSequence_GET_ITEM() and PyStructSequence_SET_ITEM() are now
  aliases to PyStructSequence_GetItem() and
  PyStructSequence_SetItem().
2023-06-28 03:45:57 +02:00
T. Wouters 161012fc25
GH-106160: Fix test_gzip failing under WASI, which does not have zlib. (#106167)
Fix test_gzip's failure under WASI, which does not have zlib, by using
test.support.import_helper.import_module to import zlib. (gzip
unconditionally imports zlib, so this does not cause any new skips.)
2023-06-28 00:55:11 +00:00
Victor Stinner 84caa3324a
gh-106084: Remove _PyObject_CallMethod() function (#106159)
Remove the following private functions from the public C API:

* _Py_CheckFunctionResult()
* _PyObject_CallMethod()
* _PyObject_CallMethodId()
* _PyObject_CallMethodIdNoArgs()
* _PyObject_CallMethodIdObjArgs()
* _PyObject_CallMethodIdOneArg()
* _PyObject_MakeTpCall()
* _PyObject_VectorcallMethodId()
* _PyStack_AsDict()

Move these functions to the internal C API (pycore_call.h).

No longer export the following functions:

* _PyObject_Call()
* _PyObject_CallMethod()
* _PyObject_CallMethodId()
* _PyObject_CallMethodIdObjArgs()
* _PyObject_Call_Prepend()
* _PyObject_FastCallDictTstate()
* _PyStack_AsDict()

The following functions are still exported for stdlib shared
extensions:

* _Py_CheckFunctionResult()
* _PyObject_MakeTpCall()

Mark the following internal functions as extern:

* _PyStack_UnpackDict()
* _PyStack_UnpackDict_Free()
* _PyStack_UnpackDict_FreeNoDecRef()
2023-06-28 01:34:37 +02:00
Guido van Rossum 6b5166fb12
gh-104584: Change DEOPT_IF in uops executor (#106146)
This effectively reverts bb578a0, restoring the original DEOPT_IF() macro in ceval_macros.h, and redefining it in the Tier 2 interpreter. We can get rid of the PREDICTED() macros there as well!
2023-06-27 14:17:41 -07:00
Irit Katriel 5290881009
gh-106149: move jump target resolution from optimizer to assembler (#106150) 2023-06-27 20:24:58 +01:00
Terry Jan Reedy eaa1eae55e
IDLE: Condense run.main threading.Thread start. (#106125)
Use daemon argument added in 3.3 and directly call .start.
Remove now unused 'sockthread' name.
2023-06-27 13:12:56 -04:00
Pablo Galindo Salgado 9126a6a9ce
gh-106140: Reorder some more fields to facilitate out-of-process inspection (#106148) 2023-06-27 16:09:15 +00:00
Pablo Galindo Salgado 2d5a1c2811
gh-106140: Reorder some fields to facilitate out-of-process inspection (#106143)
Signed-off-by: Pablo Galindo <pablogsal@gmail.com>
2023-06-27 16:26:53 +01:00
Guido van Rossum bb578a0c30
gh-104584: Fix assert in DEOPT macro -- should fix buildbot (#106131) 2023-06-27 07:02:51 -07:00
Guido van Rossum 0762775a15
gh-104584: Add #line directives to executor_cases.c.h (#106126) 2023-06-27 06:56:39 -07:00
Nikita Sobolev 33608fd67d
gh-92788: Add docs for `ast.Module`, `ast.Expression`, and others (#101055) 2023-06-27 06:43:49 -07:00
Raymond Hettinger a8210b6df1
GH-105774: Clarify operation of normalize() (GH-106093) 2023-06-26 23:12:22 -05:00
Skip Montanaro 0345b0c2bb
gh-106123: Modules/_sha3 appears to no longer be necessary (#106124) 2023-06-26 20:40:34 -07:00
Guido van Rossum 51fc725117
gh-104584: Baby steps towards generating and executing traces (#105924)
Added a new, experimental, tracing optimizer and interpreter (a.k.a. "tier 2"). This currently pessimizes, so don't use yet -- this is infrastructure so we can experiment with optimizing passes. To enable it, pass ``-Xuops`` or set ``PYTHONUOPS=1``. To get debug output, set ``PYTHONUOPSDEBUG=N`` where ``N`` is a debug level (0-4, where 0 is no debug output and 4 is excessively verbose).

All of this code is likely to change dramatically before the 3.13 feature freeze. But this is a first step.
2023-06-26 19:02:57 -07:00
Łukasz Langa d3af83b934
Revert "GH-96145: Add AttrDict to JSON module for use with object_hook (#96146)" (#105948)
This reverts commit 1f0eafa844.
2023-06-26 20:35:53 +02:00
Roderich Schupp 512f299e55
gh-106107: document correct error that's raised when a mutable default value for a field is detected (gh-106109) 2023-06-26 14:00:21 -04:00
Barney Gale 219effa876
GH-105793: Add follow_symlinks argument to `pathlib.Path.is_dir()` and `is_file()` (GH-105794)
Brings `pathlib.Path.is_dir()` and `in line with `os.DirEntry.is_dir()`, which
will be important for implementing generic path walking and globbing.
Likewise `is_file()`.
2023-06-26 17:58:17 +01:00
Paul Moore 5d4dbf0e30
gh-106111: Remove zipapp documentation on creating a Windows executable (#106112)
Remove zipapp documentation on creating a Windows executable
2023-06-26 18:14:20 +02:00
Bruce Eckel 1a2bc94fc2
Update test.support.interpreters to include missing RunFailedError import (#103841)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-06-26 17:30:20 +02:00
Victor Stinner e8e59ee474
gh-106084: Remove _PyObject_RealIsInstance() function (#106106)
Remove the following functions from the public C API:

* _PyObject_RealIsInstance()
* _PyObject_RealIsSubclass()
* _Py_add_one_to_index_F()
* _Py_add_one_to_index_C()

Move _PyObject_RealIsInstance() and _PyObject_RealIsSubclass() to the
internal C API (pycore_abstract.h) and no longer export their symbols
(in libpython).

Make _Py_add_one_to_index_F() and _Py_add_one_to_index_C() functions
static: no longer export them.
2023-06-26 13:38:41 +00:00
Victor Stinner 6200aaf296
gh-106084: Remove _PyObject_HasLen() function (#106103)
Remove _PyObject_HasLen() and _PySequence_IterSearch() functions from
the public C API: move them to the internal C API
(pycore_abstract.h).

No longer export these symbols (in libpython).

Remove also unused pycore_initconfig.h include in typeobject.c.
2023-06-26 13:02:43 +00:00
Victor Stinner c075a1974b
gh-105927: Deprecate PyWeakref_GetObject() function (#106006)
Deprecate PyWeakref_GetObject() and PyWeakref_GET_OBJECT() functions.
2023-06-26 12:10:53 +02:00
Gabriel Venberg dac3d389e7
gh-104527: zippapp will now avoid appending an archive to itself. (gh-106076)
zippapp will now avoid appending an archive to itself.
2023-06-26 10:09:08 +01:00
James Webber a12e8ffb49
gh-106075: add `asyncio.taskgroups.__all__` to `asyncio.__all__` (#106090)
Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
2023-06-26 07:54:03 +00:00
Alex Waygood 3eeb8c8906
Improve typing docs on the type of class objects (#106081) 2023-06-26 00:13:48 -07:00
Victor Stinner 7ca871634e
gh-106084: Remove _PySequence_BytesToCharpArray() function (#106088)
Remove private _PySequence_BytesToCharpArray() and
_Py_FreeCharPArray() functions from the public C API: move these
functions from Objects/abstract.c to Modules/_posixsubprocess.c.
2023-06-26 08:30:59 +02:00
Victor Stinner 00e75a3372
gh-106084: Remove old PyObject call aliases (#106085)
Remove old aliases which were kept backwards compatibility with
Python 3.8:

* _PyObject_CallMethodNoArgs()
* _PyObject_CallMethodOneArg()
* _PyObject_CallOneArg()
* _PyObject_FastCallDict()
* _PyObject_Vectorcall()
* _PyObject_VectorcallMethod()
* _PyVectorcall_Function()

Update code which used these aliases to use new names.
2023-06-26 08:08:12 +02:00
Alex Waygood 93a970ffbc
gh-106046: Improve error message from `os.fspath` if `__fspath__` is set to `None` (#106082) 2023-06-26 00:06:12 +01:00
Hugo van Kemenade 8c24a83737
Add end-of-file-fixer to pre-commit (#106065) 2023-06-25 04:44:23 -06:00
Erlend E. Aasland bef1c8761e
Docs: add links to 'callable' term in sqlite3 docs (#106072) 2023-06-25 02:02:59 +02:00
Gregory P. Smith 19d6511b0b
gh-106033: [docs] Improve C API GetItem & HasAttr notes. (#106047)
Use a note:: tag so that these dict and object API deficiencies show up clearly.

A caution:: tag was considered, but our current python docs rendering doesn't do much with that (no box or color change).  warning:: seemed too extreme.  note looks good.
2023-06-24 16:29:26 -07:00
Barney Gale 4a6c84fc1e
GH-104375: Use `versionchanged` to describe new arguments in pathlib docs (GH-104376) 2023-06-24 16:14:09 +01:00
chgnrdv d2cbb6e918
gh-105987: Fix reference counting issue in `_asyncio._swap_current_task` (#105989) 2023-06-24 10:53:24 +05:30
Erlend E. Aasland 4849a80dd1
gh-102251: Disable non-rerunnable test in test_import (#106013) 2023-06-24 01:34:05 +02:00
Eamon Tracey 8ef0ee4ebc
Typing docs: fix typo in annotating tuples comment (#106048) 2023-06-23 21:34:05 +01:00
Irit Katriel d8ca5a11bc
gh-105730: support more callables in ExceptionGroup.split() and subgroup() (#106035) 2023-06-23 19:47:47 +01:00
Serhiy Storchaka 1d33d53780
gh-106033: Get rid of new occurrences of PyDict_GetItem and PyObject_HasAttr (GH-106034)
These functions are broken by design because they discard any exceptions raised
inside, including MemoryError and KeyboardInterrupt.  They should not be
used in new code.
2023-06-23 20:10:32 +03:00
Erlend E. Aasland 41ad4dfc04
gh-105063: Disable test_peg_generator.TestCParser bco. ref leaks (#106024)
Since gh-104798 (Use setuptools in peg-generator and reenable
tests), the TestCParser test case has been producing ref leaks.
2023-06-23 19:04:17 +02:00
Serhiy Storchaka c8c162ef52
gh-106030: Miscellaneous fixes in Python/suggestions.c (GH-106031)
* PyDict_GetItem() and PyObject_HasAttr() suppress arbitrary errors and
  should not be used.
* PyUnicode_CompareWithASCIIString() only works if the second argument
  is ASCII string.
* Refleak in get_suggestions_for_name_error.
* Use of borrowed pointer after possible freeing (self).
* Add some missing error checks.
2023-06-23 19:53:27 +03:00
Alex Waygood 9499b0f138
gh-105974: Revert unintentional behaviour change for protocols with non-callable members and custom `__subclasshook__` methods (#105976) 2023-06-23 14:59:25 +00:00
Alex Waygood 968435ddb1
Typing docs: improve the guidance on annotating tuples (#106021) 2023-06-23 15:33:20 +01:00
Erlend E. Aasland 37c5c40125
gh-85136: Remove disabled remote IMAP tests (#106022)
Tests had been disabled since Jun 12, 2020 (gh-20836).
2023-06-23 13:39:50 +00:00
Mark Shannon 9339d70ac2
GH-106012: Fix monitoring of static code objects (GH-106017) 2023-06-23 13:18:29 +01:00
Alex Waygood a72683ba8e
Docs: Avoid a DeprecationWarning in `pyspecific.py` when running with Sphinx >=6.1 (#105886)
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2023-06-23 08:58:45 +01:00
Victor Stinner 6a80664ef1
gh-105927: Remove _PyWeakref_GetWeakrefCount() (#106007)
Remove _PyWeakref_GetWeakrefCount() and _PyWeakref_ClearRef() from
the public C API: move them to the internal C API.

Refactor also _weakref_getweakrefs() code to make it more readable.
2023-06-23 03:00:56 +00:00