Commit Graph

27717 Commits

Author SHA1 Message Date
Victor Stinner 9c44656feb
gh-105927: Add PyWeakref_GetRef() function (#105932)
Add tests on PyWeakref_NewRef(), PyWeakref_GetObject(),
PyWeakref_GET_OBJECT() and PyWeakref_GetRef().
2023-06-21 11:40:09 +02:00
Victor Stinner 03f1a132ee
gh-105922: Add PyImport_AddModuleRef() function (#105923)
* Add tests on PyImport_AddModuleRef(), PyImport_AddModule() and
  PyImport_AddModuleObject().
* pythonrun.c: Replace Py_XNewRef(PyImport_AddModule(name)) with
  PyImport_AddModuleRef(name).
2023-06-20 08:48:14 +02:00
Crowthebird 28187a9c4f
gh-105908: fix `barry_as_FLUFL` future import (#105909) 2023-06-19 22:50:57 +01:00
T. Wouters 1858db7cbd
GH-105808: Fix a regression introduced in GH-101251 (#105910)
Fix a regression introduced in pythonGH-101251, causing GzipFile.flush() to
not flush the compressor (nor pass along the zip_mode argument).
2023-06-19 17:09:04 +00:00
Erlend E. Aasland 6849acb3fe
gh-105875: Require SQLite 3.15.2 or newer (#105876)
SQLite 3.15.2 was released 2016-11-28.
2023-06-19 00:29:08 +02:00
Irit Katriel 14d01262da
gh-105481: remove HAS_ARG, HAS_CONST, IS_JUMP_OPCODE, IS_PSEUDO_OPCODE and replace by their new versions (#105865) 2023-06-17 17:00:16 +01:00
Brandt Bucher 2beab5bdef
GH-105840: Fix assertion failures when specializing calls with too many __defaults__ (GH-105847) 2023-06-16 11:01:15 -07:00
Jelle Zijlstra 957a974d4f
gh-104799: PEP 695 backward compatibility for ast.unparse (#105846) 2023-06-16 09:31:23 -07:00
Tian Gao 25a64fd28a
GH-103124: Multiline statement support for pdb (GH-103125) 2023-06-15 23:34:42 +00:00
Brandt Bucher a4056c8f9c
GH-105588: Add missing error checks to some obj2ast_* converters (GH-105589) 2023-06-15 15:45:13 -07:00
Lysandros Nikolaou 3af2dc7588
gh-105831: Fix NEWS blurb from gh-105828 (#105833) 2023-06-15 19:10:33 +02:00
Lysandros Nikolaou d382ad4915
gh-105820: Fix tok_mode expression buffer in file & readline tokenizer (#105828) 2023-06-15 16:21:24 +00:00
Pablo Galindo Salgado 12b6d844d8
gh-105800: Issue SyntaxWarning in f-strings for invalid escape sequences (#105801) 2023-06-15 01:08:12 +01:00
Mark Shannon 1d857da7f0
GH-77273: Better bytecodes for f-strings (GH-6132) 2023-06-14 16:15:08 +01:00
Alex Waygood 7b1f0f204a
gh-105570: Deprecate unusual ways of creating empty TypedDicts (#105780)
Deprecate two methods of creating typing.TypedDict classes with 0 fields using the functional syntax: `TD = TypedDict("TD")` and `TD = TypedDict("TD", None)`. Both will be disallowed in Python 3.15. To create a TypedDict class with 0 fields, either use `class TD(TypedDict): pass` or `TD = TypedDict("TD", {})`.
2023-06-14 14:58:41 +00:00
Mark Shannon 7199584ac8
GH-100987: Allow objects other than code objects as the "executable" of an internal frame. (GH-105727)
* Add table describing possible executable classes for out-of-process debuggers.

* Remove shim code object creation code as it is no longer needed.

* Make lltrace a bit more robust w.r.t. non-standard frames.
2023-06-14 13:46:37 +01:00
Alex Waygood ad56340b66
gh-105566: Deprecate unusual ways of creating `typing.NamedTuple` classes (#105609)
Deprecate creating a typing.NamedTuple class using keyword arguments to denote the fields (`NT = NamedTuple("NT", x=int, y=str)`). This will be disallowed in Python 3.15. Use the class-based syntax or the functional syntax instead.

Two methods of creating `NamedTuple` classes with 0 fields using the functional syntax are also deprecated, and will be disallowed in Python 3.15: `NT = NamedTuple("NT")` and `NT = NamedTuple("NT", None)`. To create a `NamedTuple` class with 0 fields, either use `class NT(NamedTuple): pass` or `NT = NamedTuple("NT", [])`.
2023-06-14 13:38:49 +01:00
Jelle Zijlstra fc8037d84c
gh-104873: Add typing.get_protocol_members and typing.is_protocol (#104878)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-06-14 05:35:06 -07:00
Kirill Podoprigora ba516e70c6
gh-102541: Hide traceback in help prompt (gh-102614) 2023-06-14 21:17:12 +09:00
Nikita Sobolev e5d45b7444
gh-105745: Fix open method of webbrowser.Konqueror (#105746) 2023-06-14 12:29:16 +02:00
Nikita Sobolev 67f69dba0a
gh-105687: Remove deprecated objects from `re` module (#105688) 2023-06-14 12:26:20 +02:00
Eddie Elizondo 6199fe3b32
gh-105587: Remove assertion from `_PyStaticObject_CheckRefcnt` (#105638) 2023-06-14 10:03:32 +05:30
Victor Stinner b542972dc1
gh-105387: Limited C API implements Py_INCREF() as func (#105388)
In the limited C API version 3.12, Py_INCREF() and Py_DECREF()
functions are now implemented as opaque function calls to hide
implementation details.
2023-06-14 02:33:00 +02:00
zentarim f3266c05b6
GH-104554: Add RTSPS support to `urllib/parse.py` (#104605)
* GH-104554: Add RTSPS support to `urllib/parse.py`

RTSPS is the permanent scheme defined in
https://www.iana.org/assignments/uri-schemes/uri-schemes.xhtml
alongside RTSP and RTSPU schemes.

* 📜🤖 Added by blurb_it.

---------

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
2023-06-13 16:45:47 -07:00
Eric Snow 757b402ea1
gh-104812: Run Pending Calls in any Thread (gh-104813)
For a while now, pending calls only run in the main thread (in the main interpreter).  This PR changes things to allow any thread run a pending call, unless the pending call was explicitly added for the main thread to run.
2023-06-13 15:02:19 -06:00
Victor Stinner 2211454fe2
gh-105733: Deprecate ctypes SetPointerType() and ARRAY() (#105734) 2023-06-13 18:16:26 +00:00
Eric Snow b97e14a806
gh-105603: Change the PyInterpreterConfig.own gil Field (gh-105620)
We are changing it to be more flexible that a strict bool can be for possible future expanded used cases.
2023-06-13 11:08:32 -06:00
Mark Shannon 09ffa69e2e
GH-105678: Split MAKE_FUNCTION into MAKE_FUNCTION and SET_FUNCTION_ATTRIBUTE (GH-105680) 2023-06-13 09:51:05 +01:00
Erlend E. Aasland 217589d4f3
gh-105375: Improve error handling in _Unpickler_SetInputStream() (#105667)
Prevent exceptions from possibly being overwritten in case of multiple
failures.
2023-06-13 10:38:01 +02:00
Kumar Aditya 840d02f3f0
GH-105684: Require `asyncio.Task` implementations to support `set_name` method (#105685) 2023-06-13 06:06:40 +00:00
Jay f0fb782ddb
gh-105331: Change `asyncio.sleep` to raise ``ValueError` for nan (#105641)
Co-authored-by: Guido van Rossum <gvanrossum@gmail.com>
Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
2023-06-12 20:29:02 +00:00
Dora203 4f7d3b602d
gh-105436: The environment block should end with two null wchar_t values (GH-105495) 2023-06-12 17:14:55 +01:00
Petr Viktorin 2b90796be6
gh-103968: PyType_FromMetaclass: Allow metaclasses with tp_new=NULL (GH-105386) 2023-06-12 17:45:49 +02:00
Erlend E. Aasland 20a56d8bec
gh-105375: Harden pyexpat initialisation (#105606)
Add proper error handling to add_errors_module() to prevent exceptions
from possibly being overwritten.
2023-06-11 20:18:46 +00:00
Erlend E. Aasland 41cddc2e93
gh-105375: Improve error handling in the sys extension module (#105611)
In _PySys_AddXOptionWithError() and sys_add_xoption(),
bail on first error to prevent exceptions from possibly being
overwritten.
2023-06-11 20:02:49 +00:00
Erlend E. Aasland e8998e46a7
gh-105375: Improve error handling in _ctypes (#105593)
Prevent repeated PyLong_FromVoidPtr() from possibly overwriting the
current exception.
2023-06-11 19:46:19 +00:00
Erlend E. Aasland 555be81026
gh-105375: Improve error handling in PyUnicode_BuildEncodingMap() (#105491)
Bail on first error to prevent exceptions from possibly being overwritten.
2023-06-11 21:29:19 +02:00
Erlend E. Aasland 567d6ae8e7
gh-105375: Improve PyErr_WarnExplicit() error handling (#105610)
Bail on first error to prevent exceptions from possibly being
overwritten.
2023-06-11 21:23:28 +02:00
Samet YASLAN 3f7c0810f6
bpo-44185: Added close() to mock_open __exit__ (#26902) 2023-06-11 19:51:21 +01:00
Tomas R 18d16e93b6
gh-102676: Add more convenience properties to `dis.Instruction` (#103969)
Adds start_offset, cache_offset, end_offset, baseopcode,
baseopname, jump_target and oparg to dis.Instruction.

Also slightly improves the disassembly output by allowing
opnames to overflow into the space reserved for opargs.
2023-06-11 08:50:34 -07:00
Erlend E. Aasland d4fa52934a
gh-105375: Improve error handling in the builtins extension module (#105585) 2023-06-11 12:20:43 +02:00
Erlend E. Aasland c932f72849
gh-105375: Improve _decimal error handling (#105605)
Fix a bug where an exception could end up being overwritten.
2023-06-11 12:06:06 +02:00
Erlend E. Aasland 16d49680b5
gh-105375: Harden _datetime initialisation (#105604)
Improve error handling so init bails on the first exception.
2023-06-11 12:03:09 +02:00
Erlend E. Aasland 35cff545db
gh-105375: Improve array.array exception handling (#105594)
Fix a bug where 'tp_richcompare' could end up overwriting an exception.
2023-06-11 11:58:08 +02:00
Erlend E. Aasland 01f4230460
gh-105375: Harden _ssl initialisation (#105599)
Add proper error handling to prevent reference leaks and overwritten
exceptions.
2023-06-11 11:56:32 +02:00
Hugo van Kemenade cc879481e2
gh-80480: Emit DeprecationWarning for array's 'u' type code (#95760) 2023-06-11 03:17:35 -06:00
Nikita Sobolev 33c92c4f15
gh-105375: Improve error handling in `zoneinfo` module (#105586)
Fix bugs where exceptions could end up being overwritten
because of deferred error handling.

Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
2023-06-09 21:48:54 +00:00
Erlend E. Aasland 91441bf7cb
Docs: fix formatting in 2023-06-09-12-59-18 NEWS item (#105607) 2023-06-09 23:14:02 +02:00
Pablo Galindo Salgado b047fa5e56
gh-105549: Tokenize separately NUMBER and NAME tokens and allow 0-prefixed literals (#105555) 2023-06-09 21:39:01 +01:00
Erlend E. Aasland 00b599ab5a
gh-105375: Improve error handling in _elementtree (#105591)
Fix bugs where exceptions could end up being overwritten.
2023-06-09 22:35:03 +02:00