Commit graph

119976 commits

Author SHA1 Message Date
Serhiy Storchaka 8f8f0f97e1
gh-61648: Detect line numbers of properties in doctests (GH-113161) 2023-12-15 15:24:30 +02:00
Brandt Bucher 737d23ffcd
GH-111485: Mark some instructions as TIER_ONE_ONLY (GH-113155) 2023-12-15 13:03:17 +00:00
Irit Katriel 55ef998a8d
gh-112720: Move dis's cache output code to the Formatter, labels lookup to the arg_resolver. Reduce the number of parameters passed around. (#113108) 2023-12-15 12:28:22 +00:00
Alex Waygood 7bb00f053e
gh-101100: Fix Sphinx nitpicks in library/rlcompleter.rst (#113125) 2023-12-15 10:57:23 +02:00
Furkan Onder f34e22c647
gh-112535: Update _Py_ThreadId() to support RISC-V (gh-113084)
Update _Py_ThreadId() to support RISC-V
2023-12-15 08:42:33 +09:00
Raymond Hettinger 5f7d7353b4
Optimize unique_justseen() recipe for a common case. (gh-113147) 2023-12-14 17:27:39 -06:00
Alex Waygood 25061f5c98
gh-101100: Cleanup mailbox docs (#113124) 2023-12-14 14:10:26 -07:00
Hugo van Kemenade 961f1043a0
gh-101100: Fix Sphinx warnings in whatsnew/2.3.rst (#112373) 2023-12-14 13:48:36 -07:00
Raymond Hettinger becad9a2a1
Remove itertool recipe with low pedagogical value (gh-113138) 2023-12-14 14:36:40 -06:00
Alex Waygood 006355b2a9
gh-101100: Fix Sphinx nitpicks in library/collections.abc.rst (#113116) 2023-12-14 19:25:55 +00:00
Raymond Hettinger 93cf7358d9
Add recipe for totient() to demonstrate unique_justseen() and factor(). (gh-113131) 2023-12-14 13:15:29 -06:00
Ronald Oussoren 22511f77c2
gh-105912: document gotcha with using os.fork on macOS (#112871)
* gh-105912: document gotcha with using os.fork on macOS

Using ``fork(2)`` on macOS when also using higher-level
system APIs in the parent proces can crash on macOS because
those system APIs are not written to handle this usage
pattern.

There's nothing we can do about this other than documenting
the problem.

Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
2023-12-14 20:14:50 +01:00
Zackery Spytz a723a13bf1
bpo-36796: Clean the error handling in _testcapimodule.c (GH-13085) 2023-12-14 19:06:53 +00:00
Mark Shannon e24eccbc1c
GH-111485: Sort metadata tables for easier checking of future diffs (GH-113101) 2023-12-14 16:41:52 +00:00
jeremy-dolan fb4cb7ce31
gh-113113: doc: use less ambiguously named variable (gh-113114) 2023-12-14 15:40:24 +00:00
Steve Dower fd81afc624
gh-86179: Avoid making case-only changes when calculating realpath() during initialization (GH-113077) 2023-12-14 15:16:39 +00:00
Mark Shannon 6873555955
GH-112354: Treat _EXIT_TRACE like an unconditional side exit (GH-113104) 2023-12-14 14:26:44 +00:00
Alex Waygood d9e1b5794a
gh-101100: Fix Sphinx nitpicks in library/traceback.rst (#113106) 2023-12-14 14:10:35 +00:00
Alex Waygood 4b3cb082da
gh-101100: Fix Sphinx nitpicks in library/inspect.rst and reference/simple_stmts.rst (#113107) 2023-12-14 13:30:57 +00: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 c6e953be12
gh-113090: Fix test.support.os_support.can_chmod() on Windows (GH-113091) 2023-12-14 13:27:43 +02:00
Donghee Na 23a5711100
gh-112205: Update textio module to use @getter as possible. (gh-113095) 2023-12-14 10:26:46 +00:00
Daniel Wysocki b3c21265fa
Fixing typo in DocTestRunner docs (GH-112326) 2023-12-14 12:07: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
Stephen Gildea 4d5d9acb22
gh-90890: Reorder mailbox.Maildir method documentation (GH-113071)
When new mailbox.Maildir methods were added for 3.13.0a2, their
documentation was added at the end of the mailbox.Maildir section
instead of grouping them with other methods Maildir adds to Mailbox.

This commit moves the new methods' documentation adjacent to
documentation for existing Maildir-specific methods, so that
the "special remarks" for common methods remains at the end.
2023-12-14 09:53:08 +02:00
Serhiy Storchaka b4f2c89118
gh-113086: Add tests for os.chmod() and os.lchmod() (GH-113087)
Also make test_copymode_symlink_to_symlink in test_shutil more strict.
2023-12-14 09:16:06 +02:00
Steve Dower fddc829236
gh-86179: Implement realpath() on Windows for getpath.py calculations (GH-113033) 2023-12-13 23:41:43 +00:00
Guido van Rossum 41c18aacc7
Move optimizer/executor tests to new file test_capi/test_opt.py (#113072) 2023-12-13 21:49:29 +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
Christoph Anton Mitterer f14e3d59c9
gh-107959: clarify Unix-availability of os.lchmod() (GH-107960)
POSIX specifies that implementations are not required to support changing the
file mode of symbolic links, but may do so.
Consequently, `lchmod()` is not part of POSIX (but mentioned for implementations
which do support the above).

The current wording of the availability of `os.lchmod()` is rather vague and
improved to clearly tell which POSIX/Unix/BSD-like support the function in
general (those that support changing the file mode of symbolic links).
Further, some examples of major implementations are added.

Data for the BSDs taken from their online manpages.

Signed-off-by: Christoph Anton Mitterer <mail@christoph.anton.mitterer.name>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2023-12-13 21:55:31 +02:00
Miro Hrončok 85923cb377
Docs: Fix external link to devguide.python.org (GH-112899) 2023-12-13 11:37:13 -08:00
Alex Waygood d05a180350
gh-101100: Improve docs on exception attributes (GH-113057)
* Improve docs on exception attributes

* thanks sphinx-lint

* fix doctests

* argh, okay, give up on doctests

* Various improvements
2023-12-13 10:59:36 -08:00
Raymond Hettinger 2111795d0c
Use match/case in grouper() recipe (gh-113059)
Use match/case in grouper() reciper
2023-12-13 12:11:52 -06:00
Eric Snow 480b4b359d
gh-76785: Fix CODEOWNERS (gh-113038)
In gh-112982 I made some changes to .github/CODEOWNERS.  Later, @ezio-melotti pointed out that some of those changes were unnecessary.
2023-12-13 09:29:40 -07: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
Donghee Na 498a096a51
gh-112205: Support @setter annotation from AC (gh-112922)
---------

Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-12-13 14:00:34 +00:00
Mark Shannon 9263173280
Fix whitespace in generated code 2023-12-13 12:31:41 +00:00
Sequew 2a3c37c273
[pprint]: Add docstring about PrettyPrinter.underscore_numbers parameter (#112963)
Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
2023-12-13 12:04:17 +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
Eric Snow c6e614fd81
gh-76785: Avoid Pickled TracebackException for Propagated Subinterpreter Exceptions (gh-113036)
We need the TracebackException of uncaught exceptions for a single purpose: the error display.  Thus we only need to pass the formatted error display between interpreters.  Passing a pickled TracebackException is overkill.
2023-12-13 00:31:30 +00: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
Sam Gross a3c031884d
gh-112723: Call PyThreadState_Clear() from the correct interpreter (#112776)
The `PyThreadState_Clear()` function must only be called with the GIL
held and must be called from the same interpreter as the passed in
thread state. Otherwise, any Python objects on the thread state may be
destroyed using the wrong interpreter, leading to memory corruption.

This is also important for `Py_GIL_DISABLED` builds because free lists
will be associated with PyThreadStates and cleared in
`PyThreadState_Clear()`.

This fixes two places that called `PyThreadState_Clear()` from the wrong
interpreter and adds an assertion to `PyThreadState_Clear()`.
2023-12-12 17:20:21 -07:00
Eric Snow 8a4c1f3ff1
gh-76785: Show the Traceback for Uncaught Subinterpreter Exceptions (gh-113034)
When an exception is uncaught in Interpreter.exec_sync(), it helps to show that exception's error display if uncaught in the calling interpreter.  We do so here by generating a TracebackException in the subinterpreter and passing it between interpreters using pickle.
2023-12-13 00:00:54 +00: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