Commit Graph

28523 Commits

Author SHA1 Message Date
Yan Yanchii 4a3d2419bb
gh-113212: Improve error message & document zero-arg super inside nested functions and generator expressions (GH-113307) 2023-12-22 17:12:08 +02:00
Mark Shannon 45e09f921b
GH-112215: Increase C recursion limit for non debug builds (GH-113397) 2023-12-22 14:25:25 +00:00
Irit Katriel c31943af16
gh-113297: Fix segfault in compiler for with statement with 19 context managers (#113327) 2023-12-22 01:50:26 +00:00
Shantanu 61e8184095
gh-95754: Better AttributeError on partially initialised module (#112577)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-12-21 13:24:10 -08:00
Jason R. Coombs 2d91409c69
gh-113174: Sync with importlib_metadata 7.0 (#113175)
* Sync with importlib_metadata 7.0.0

* Add blurb

* Update docs to reflect changes.

* Link datamodel docs for object.__getitem__

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>

* Add what's new for removed __getattr__

* Link datamodel docs for object.__getitem__

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>

* Add exclamation point, as that seems to be used for other classes.

---------

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-12-21 15:04:05 -05:00
Ronald Oussoren df1eec3dae
gh-65701: document that freeze doesn't work with framework builds on macOS (#113352)
* gh-65701: document that freeze doesn't work with framework builds on macOS

The framework install is inherently incompatible with freeze. Document
that that freeze doesn't work with framework builds and bail out
early when trying to run freeze anyway.

Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
2023-12-21 16:28:00 +01:00
Ronald Oussoren ca8b1d0958
gh-87277: Don't look for X11 browsers on macOS in webbrowser (#24480)
The installation of XQuartz on macOS will unconditionally
set the $DISPLAY variable. The X11 server will be launched
when a program tries to access the display.  This results
in launching the X11 server when using the webbrowser module,
even though X11 browsers won't be used in practice.
2023-12-21 14:43:38 +01:00
Gregory P. Smith 103c4ea274
gh-112305: Fix check-clean-src to detect frozen_modules .h files. (#113344)
A typo left this check broken so many of us who do out-of-tree builds
were seeing strange failures due to bad `Python/frozen_modules/*.h`
files being picked up from the source tree and used at build time from
different Python versions leading to errors like:

`Fatal Python error: _PyImport_InitCore: failed to initialize importlib`

Or similar once our build got to an "invoke the interpreter"
bootstrapping step due to incorrect bytecode being embedded.
2023-12-20 23:32:13 -08:00
Carey Metcalfe a2dd0e7038
gh-111375: Use `NULL` rather than `None` in the exception stack to indicate that an exception was handled (#113302) 2023-12-21 01:46:41 +00:00
Martijn Pieters 1ff0238594
GH-113214: Fix SSLProto exception handling in SSL-over-SSL scenarios (#113334)
When wrapped, `_SSLProtocolTransport._force_close(exc)` is called just like in the unwrapped scenario `_SelectorTransport._force_close(exc)` or `_ProactorBasePipeTransport._force_close(exc)` would be called, except here the exception needs to be passed through the `SSLProtocol._abort()` method, which didn't accept an exception object.

This commit ensures that this path works, in the same way that the uvloop implementation of SSLProto passes on the exception (on which the current implementation of SSLProto is based).
2023-12-20 15:09:01 -08:00
Seth Michael Larson b221e03010
gh-113257: Automatically generate pip SBOM metadata from wheel (#113295)
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2023-12-20 17:28:20 +00:00
Ethan Furman 4afa7be32d
add Ujan to ACKS for work on enum docs (GH-113301) 2023-12-19 17:55:24 -08:00
Erlend E. Aasland 14d4c7742a
gh-111973: Update Windows installer to use SQLite 3.44.2 (#113281) 2023-12-19 23:31:52 +01:00
Marat Idrisov e1117cb886
gh-87264: Convert tarinfo type to stat type (GH-113230)
Co-authored-by: val-shkolnikov <val@nvsoft.net>
2023-12-19 11:04:43 -08:00
Erlend E. Aasland 6a1d5a4c0f
gh-111973: Update macOS installer to use SQLite 3.44.2 (GH-113279) 2023-12-19 13:23:52 -05:00
Hugo van Kemenade 76bef3832b
gh-101100: Fix Sphinx warnings in `library/ast.rst` (#113289)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-12-19 15:44:57 +00:00
Irit Katriel e51b400945
gh-113054: Compiler no longer replaces a redundant jump with no line number by a NOP (#113139) 2023-12-19 11:04:44 +00:00
Seth Michael Larson 4658464e9c
gh-113257: Fix SBOM metadata for pip 23.3.2 (#113262)
Fix SBOM metadata for pip 23.3.2
2023-12-19 08:34:53 +02:00
Terry Jan Reedy fa9ba02353
gh-113269: IDLE - Fix test_editor hang (macOS) (#113271)
Hangs on installed 3.13.0a2 on macOS Catalina.
Behavior on installed 3.12.1 and 3.11.7 is unknown.
2023-12-19 05:26:11 +00:00
Ronald Oussoren 893c9ccf48
gh-102362: Fix macOS version number in result of sysconfig.get_platform() (GH-112942)
Change _osx_support.get_platform_osx() to make sure that the
version number in the result includes at least a major and
minor version (e.g. 14.2) even if MACOSX_DEPLOYMENT_TARGET is
set to just a major version (e.g. 14).

This matches the versions expected by pip when selecting
appropriate wheels for installation.
2023-12-18 18:51:58 -05:00
Ronald Oussoren 4cfce3a4da
gh-108269: Add CFBundleAllowMixedLocalizations to Info.plist on macOS (GH-113213)
Adding this key with a value of true enables detecting the
users prefered language in libraries accessing system APIs
for this.
2023-12-18 18:41:41 -05:00
Illia Volochii 41336a72b9
gh-113199: Make read1() and readline() of HTTPResponse close IO after reading all data (GH-113200) 2023-12-18 22:17:16 +02:00
Stéphane Bidoul 4a24bf9a13
gh-113246: Updated bundled pip to 23.3.2 (gh-113249)
Updated bundled pip to 23.3.2
2023-12-18 10:21:46 +00:00
Jakub Kulík 2b93f52242
gh-113117: Support posix_spawn in subprocess.Popen with close_fds=True (#113118)
Add support for `os.POSIX_SPAWN_CLOSEFROM` and
`posix_spawn_file_actions_addclosefrom_np` and have the `subprocess` module use
them when available.  This means `posix_spawn` can now be used in the default
`close_fds=True` situation on many platforms.

Co-authored-by: Gregory P. Smith [Google LLC] <greg@krypto.org>
2023-12-17 21:34:57 +00:00
Carson Radtke cfa25fe3e3
gh-113149: Improve error message when JSON has trailing comma (GH-113227) 2023-12-17 20:52:26 +02:00
Jakub Kulík 48c907a15c
gh-113119 fix environment handling in subprocess.Popen when posix_spawn is used (#113120)
* Allow posix_spawn to inherit environment form parent environ variable.

With this change, posix_spawn call can behave similarly to execv with regards to environments when used in subprocess functions.
2023-12-17 05:19:05 +00:00
Raymond Hettinger 1583c40be9
gh-113202: Add a strict option to itertools.batched() (gh-113203) 2023-12-16 09:13:50 -06:00
Mark Dickinson fe479fb8a9
gh-67790: Support basic formatting for Fraction (#111320)
PR #100161 added fancy float-style formatting for the Fraction type,
but left us in a state where basic formatting for fractions (alignment,
fill, minimum width, thousands separators) still wasn't supported.

This PR adds that support.

---------

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-12-16 10:58:31 +00:00
Akshat Khandelwal 00d2b6d1fc
gh-110746: Improve markup in ``tkinter.ttk.rst`` (#111236)
* gh-110746: Improve markup in tkinter.ttk.rst

* gh-110746: Improve markup in tkinter.ttk.rst

* 📜🤖 Added by blurb_it.

---------

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
2023-12-15 21:53:16 +01:00
Victor Stinner 4a153a1d3b
[CVE-2023-27043] gh-102988: Reject malformed addresses in email.parseaddr() (#111116)
Detect email address parsing errors and return empty tuple to
indicate the parsing error (old API). Add an optional 'strict'
parameter to getaddresses() and parseaddr() functions. Patch by
Thomas Dwyer.

Co-Authored-By: Thomas Dwyer <github@tomd.tel>
2023-12-15 16:10:40 +01:00
Victor Stinner 4026ad5b2c
gh-113009: Fix multiprocessing Process.terminate() on Windows (#113128)
On Windows, Process.terminate() no longer sets the returncode
attribute to always call WaitForSingleObject() in Process.wait().
Previously, sometimes the process was still running after
TerminateProcess() even if GetExitCodeProcess() is not STILL_ACTIVE.
2023-12-15 15:57:49 +01:00
Serhiy Storchaka 8f8f0f97e1
gh-61648: Detect line numbers of properties in doctests (GH-113161) 2023-12-15 15:24:30 +02:00
Serhiy Storchaka 1161c14e8c
gh-112716: Fix SystemError when __builtins__ is not a dict (GH-112770)
It was raised in two cases:
* in the import statement when looking up __import__
* in pickling some builtin type when looking up built-ins iter, getattr, etc.
2023-12-14 14:24:24 +02:00
Hugo van Kemenade 12f0bbd6e0
gh-112730: Update docs for colour env vars (#112837) 2023-12-14 13:36:48 +02:00
Serhiy Storchaka 29f7eb4859
gh-59616: Support os.chmod(follow_symlinks=True) and os.lchmod() on Windows (GH-113049) 2023-12-14 13:28:37 +02:00
Serhiy Storchaka bb36f72efc
gh-111049: Fix crash during garbage collection of the BytesIO buffer object (GH-111221) 2023-12-14 10:04:23 +00:00
Steve Dower fddc829236
gh-86179: Implement realpath() on Windows for getpath.py calculations (GH-113033) 2023-12-13 23:41:43 +00:00
Pavol Babinčák‏ f5c05e015c
bpo-40648: Test modes that file can get with chmod() on Windows (GH-20130)
Order of tests matter second part makes testing file writable and
possible to remove again.
2023-12-13 22:23:13 +02:00
Diego Russo 6644ca45cd
gh-110190: Fix ctypes structs with array on PPCLE64 (GH-112959)
Fix the same issue of PR #112604 on PPC64LE platform
Refactor tests to make easier to add more platfroms if needed.
2023-12-13 17:08:15 +01:00
Steve Dower 79dad03747
gh-111650: Ensure pyconfig.h includes Py_GIL_DISABLED on Windows (GH-112778) 2023-12-13 15:38:45 +00:00
Irit Katriel 428c9812cb
gh-112962: in dis module, put cache information in the Instruction instead of creating fake Instructions to represent it (#113016) 2023-12-13 12:00:21 +00:00
Hugo van Kemenade 3531ea441b
gh-101100: Fix Sphinx warning in references with asterisks (#113029)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-12-13 09:24:55 +02:00
beavailable 3aea6c4823
gh-101336: Add keep_alive keyword arg for asyncio create_server() (#112485) 2023-12-13 03:23:29 +00:00
Jamie a3a1cb4845
gh-112622: Pass name to loop create_task method (#112623)
This affects task creation through either `asyncio.create_task()` or `TaskGroup.create_task()` -- the redundant call to `task.set_name()` is skipped. We still call `set_name()` when a task factory is involved, because the task factory call signature (unfortunately) doesn't take a `name` argument.
2023-12-12 17:26:40 -08:00
J. Nick Koston 7e2d93f30b
gh-112989: asyncio: Reduce overhead to connect sockets with SelectorEventLoop (#112991)
_ensure_fd_no_transport had a KeyError in the success path
2023-12-12 16:29:21 -08:00
Guido van Rossum 7316dfb0eb
gh-112320: Implement on-trace confidence tracking for branches (#112321)
We track the confidence as a scaled int.
2023-12-12 21:43:08 +00:00
Mark Shannon 956023826a
GH-108866: Guarantee forward progress in executors. (GH-113006) 2023-12-12 19:02:24 +00:00
Sam James c454e934d3
gh-112970: Detect and use closefrom() when available (#112969)
glibc-2.34 implements closefrom(3) using the same semantics as on BSD.
Check for closefrom() in configure and use the check result in
fileutils.c, rather than hardcoding a FreeBSD check.

Some implementations of closefrom() return an int. Explicitly discard 
the return value by casting it to void, to avoid future compiler
warnings.

Signed-off-by: Sam James <sam@gentoo.org>
2023-12-12 11:25:27 +01:00
Ronald Oussoren 0d2fe6bab0
gh-87286: Add a number of LOG_* constants to syslog (#24432)
* bpo-43120: Add a number of LOG_* constants to syslog

This adds a number of syslog facilities to the syslogmodule.c.
These values are available on macOS.

* Switch contant documentation to the data directive

This fixes a CI warning and matches the pattern
used in the documentation for ``os``.

* Update Doc/library/syslog.rst


Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-12-12 10:25:51 +01:00
Steve Dower 1c5fc02fd0
gh-71383: Update Tcl/Tk version in Windows to our patched build containing a targeted upstream fix (GH-112973) 2023-12-11 21:54:17 +00:00