summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* gh-106033: [docs] Improve C API GetItem & HasAttr notes. (#106047)Gregory P. Smith2023-06-242-14/+23
| | | | | 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.
* GH-104375: Use `versionchanged` to describe new arguments in pathlib docs ↵Barney Gale2023-06-241-14/+14
| | | | (GH-104376)
* gh-105987: Fix reference counting issue in `_asyncio._swap_current_task` ↵chgnrdv2023-06-243-4/+27
| | | | (#105989)
* gh-102251: Disable non-rerunnable test in test_import (#106013)Erlend E. Aasland2023-06-231-4/+20
|
* Typing docs: fix typo in annotating tuples comment (#106048)Eamon Tracey2023-06-231-2/+2
|
* gh-105730: support more callables in ExceptionGroup.split() and subgroup() ↵Irit Katriel2023-06-234-26/+59
| | | | (#106035)
* gh-106033: Get rid of new occurrences of PyDict_GetItem and PyObject_HasAttr ↵Serhiy Storchaka2023-06-235-31/+32
| | | | | | | | (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.
* gh-105063: Disable test_peg_generator.TestCParser bco. ref leaks (#106024)Erlend E. Aasland2023-06-231-0/+10
| | | | Since gh-104798 (Use setuptools in peg-generator and reenable tests), the TestCParser test case has been producing ref leaks.
* gh-106030: Miscellaneous fixes in Python/suggestions.c (GH-106031)Serhiy Storchaka2023-06-231-15/+27
| | | | | | | | | | * 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.
* gh-105974: Revert unintentional behaviour change for protocols with ↵Alex Waygood2023-06-233-32/+79
| | | | non-callable members and custom `__subclasshook__` methods (#105976)
* Typing docs: improve the guidance on annotating tuples (#106021)Alex Waygood2023-06-231-21/+72
|
* gh-85136: Remove disabled remote IMAP tests (#106022)Erlend E. Aasland2023-06-231-95/+0
| | | Tests had been disabled since Jun 12, 2020 (gh-20836).
* GH-106012: Fix monitoring of static code objects (GH-106017)Mark Shannon2023-06-231-13/+18
|
* Docs: Avoid a DeprecationWarning in `pyspecific.py` when running with Sphinx ↵Alex Waygood2023-06-231-11/+9
| | | | | >=6.1 (#105886) Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
* gh-105927: Remove _PyWeakref_GetWeakrefCount() (#106007)Victor Stinner2023-06-234-22/+20
| | | | | | 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.
* gh-105927: _ssl GET_SOCKET() uses _PyWeakref_GET_REF() (#106002)Victor Stinner2023-06-231-2/+12
|
* gh-105927: PyImport_AddModule() uses _PyWeakref_GET_REF() (#106001)Victor Stinner2023-06-221-3/+19
| | | | | | | It now raises an exception if sys.modules doesn't hold a strong reference to the module. Elaborate the comment explaining why a weak reference is used to create a borrowed reference.
* gh-105922: Use PyImport_AddModuleRef() function (#105999)Victor Stinner2023-06-222-3/+2
| | | | Replace PyImport_AddModuleObject() + Py_XNewRef() with PyImport_AddModuleRef() to get directly a strong reference.
* Test specialization's thread-safety (GH-105953)Brandt Bucher2023-06-221-1/+511
|
* gh-105979: Fix exception handling in `unmarshal_frozen_code` ↵chgnrdv2023-06-223-0/+10
| | | | (`Python/import.c`) (#105980)
* gh-105927: Avoid calling PyWeakref_GET_OBJECT() (#105997)Victor Stinner2023-06-223-7/+21
| | | | | | | * Replace PyWeakref_GET_OBJECT() with _PyWeakref_GET_REF(). * _sqlite/blob.c now holds a strong reference to the blob object while calling close_blob(). * _xidregistry_find_type() now holds a strong reference to registered while using it.
* gh-105927: Add _PyWeakref_IS_DEAD() function (#105992)Victor Stinner2023-06-223-14/+30
| | | | | | | | * Add _PyWeakref_IS_DEAD() internal function. * Modify is_dead_weakref() of Modules/_weakref.c and _pysqlite_drop_unused_cursor_references() to replace PyWeakref_GET_OBJECT() with _PyWeakref_IS_DEAD(). * Replace "int i" with "Py_ssize_t i" to iterate on cursors in _pysqlite_drop_unused_cursor_references().
* gh-101538: Add experimental wasi-threads build (#101537)YAMAMOTO Takashi2023-06-225-3/+53
| | | | Co-authored-by: Brett Cannon <brett@python.org> Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
* gh-98931: Add custom error messages to invalid import/from with multiple ↵Pablo Galindo Salgado2023-06-224-597/+738
| | | | | | targets (#105985) Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
* GH-89812: Add `pathlib.UnsupportedOperation` (GH-105926)Barney Gale2023-06-225-13/+91
| | | | | | | This new exception type is raised instead of `NotImplementedError` when a path operation is not supported. It can be raised from `Path.readlink()`, `symlink_to()`, `hardlink_to()`, `owner()` and `group()`. In a future version of pathlib, it will be raised by `AbstractPath` for these methods and others, such as `AbstractPath.mkdir()` and `unlink()`.
* GH-91095: Specialize calls to normal Python classes. (GH-99331)Mark Shannon2023-06-2220-189/+511
|
* gh-105481: refactor instr flag related code into a new InstructionFlags ↵Irit Katriel2023-06-211-36/+78
| | | | class (#105950)
* gh-104212: Explain how to port imp.load_source() (#105978)Victor Stinner2023-06-211-1/+15
| | | | Explain how to port removed imp.load_source() to importlib in What's New in Python 3.12.
* gh-84436: update docs on Py_None/Py_True/Py_False/Py_Ellipsis becoming ↵Irit Katriel2023-06-213-19/+25
| | | | immortal (#105195)
* gh-105927: finalize_modules_clear_weaklist() uses _PyWeakref_GET_REF() (#105971)Victor Stinner2023-06-213-6/+7
| | | | | finalize_modules_clear_weaklist() now holds a strong reference to the module longer than before: replace PyWeakref_GET_OBJECT() with _PyWeakref_GET_REF().
* gh-105927: type_from_ref() uses _PyWeakref_GET_REF() (#105963)Victor Stinner2023-06-211-13/+24
| | | | | type_from_ref() now returns a strong reference to the type, instead of a borrowed reference: replace PyWeakref_GET_OBJECT() with _PyWeakref_GET_REF().
* gh-105927: Fix test_weakref_capi() refleak (#105966)Victor Stinner2023-06-211-16/+32
| | | Test PyWeakref_GetRef(NULL) and PyWeakref_GetObject(NULL).
* gh-105927: _ctypes use PyWeakref_GetRef() (#105964)Victor Stinner2023-06-211-18/+26
| | | | | | Rename PyDict_GetItemProxy() to _PyDict_GetItemProxy() and mark it as static. _PyDict_GetItemProxy() now returns a strong reference, instead of a borrowed reference: replace PyWeakref_GET_OBJECT() with _PyWeakref_GET_REF().
* gh-105927: _ssl uses _PyWeakref_GET_REF() (#105965)Victor Stinner2023-06-212-18/+29
|
* stdtypes.rst: remove a period (#105959)Mathieu Dupuy2023-06-211-1/+1
|
* gh-105927: _abc and _thread use PyWeakref_GetRef() (#105961)Victor Stinner2023-06-212-21/+20
| | | | | | | | Hold a strong reference on the object, rather than using a borrowed reference: replace PyWeakref_GET_OBJECT() with PyWeakref_GetRef() and _PyWeakref_GET_REF(). Remove assert(PyWeakref_CheckRef(localweakref)) since it's already tested by _PyWeakref_GET_REF().
* Use CSV-separated outputs @ get-changed-files @ CI (#105151)Sviatoslav Sydorenko2023-06-213-21/+32
| | | | Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
* gh-105927: Add PyWeakref_GetRef() function (#105932)Victor Stinner2023-06-2111-8/+133
| | | | Add tests on PyWeakref_NewRef(), PyWeakref_GetObject(), PyWeakref_GET_OBJECT() and PyWeakref_GetRef().
* Add Py_TYPE() to Doc/data/refcounts.dat (#105949)Victor Stinner2023-06-201-0/+3
|
* gh-105915: Fix SyntaxWarning becoming a SyntaxError with -We in test_fstring ↵Lysandros Nikolaou2023-06-201-3/+3
| | | | (#105943)
* gh-105915: Add 'r' prefix to not emit SyntaxWarning in test_fstring (#105940)Lysandros Nikolaou2023-06-201-1/+1
| | | Co-authored-by: @sunmy2019
* gh-105938: Emit a SyntaxWarning for escaped braces in an f-string (#105939)Lysandros Nikolaou2023-06-203-6/+18
|
* make regen-stdlib-module-names rejects test modules (#105921)Victor Stinner2023-06-201-2/+17
| | | Make sure that sys.stdlib_module_names doesn't contain test modules.
* gh-105927: Add _PyWeakref_GET_REF() internal function (#105929)Victor Stinner2023-06-205-49/+88
| | | Add new pycore_weakref.h internal header file.
* gh-105922: Add PyImport_AddModuleRef() function (#105923)Victor Stinner2023-06-2013-24/+149
| | | | | | * Add tests on PyImport_AddModuleRef(), PyImport_AddModule() and PyImport_AddModuleObject(). * pythonrun.c: Replace Py_XNewRef(PyImport_AddModule(name)) with PyImport_AddModuleRef(name).
* gh-105927: Refactor weakrefobject.c (#105928)Victor Stinner2023-06-191-60/+56
| | | | | | * Rename proxy_checkref() to proxy_check_ref(). * proxy_check_ref() now checks the object, not the proxy. * Most functions take PyObject* instead of PyWeakReference*. * Remove redundant calls to PyWeakref_GET_OBJECT().
* gh-105922: Refactor PyRun_InteractiveOneObjectEx() (#105925)Victor Stinner2023-06-191-74/+108
| | | | | | | | | | | Refactor PyRun_InteractiveOneObjectEx(), _PyRun_SimpleFileObject() and PyRun_SimpleStringFlags(): * Keep a strong reference to the __main__ module while using its dictionary (PyModule_GetDict()). Use PyImport_AddModule() with Py_XNewRef(). * Declare variables closer to where they are defined. * Rename variables to use name longer than 1 character. * Add pyrun_one_parse_ast() sub-function.
* gh-105481: generate _specializations and _specialized_instructions from ↵Irit Katriel2023-06-1912-277/+345
| | | | bytecodes.c (#105913)
* gh-105908: fix `barry_as_FLUFL` future import (#105909)Crowthebird2023-06-193-6/+19
|
* GH-105808: Fix a regression introduced in GH-101251 (#105910)T. Wouters2023-06-193-1/+52
| | | | Fix a regression introduced in pythonGH-101251, causing GzipFile.flush() to not flush the compressor (nor pass along the zip_mode argument).