Commit Graph

121754 Commits

Author SHA1 Message Date
Kirill Podoprigora 92c84ef831
``Objects/typeobject.c``: Fix typo (#118126) 2024-04-21 02:25:39 +00:00
Quazi Irfan 1558d99316
Clarifying nonlocal doc: SyntaxError is raised if nearest enclosing scope is global (#114009)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2024-04-20 18:42:51 -07:00
Barney Gale 15fbd53ba9
GH-112855: Speed up `pathlib.PurePath` pickling (#112856)
The second item in the tuple returned from `__reduce__()` is a tuple of arguments to supply to path constructor. Previously we returned the `parts` tuple here, which entailed joining, parsing and normalising the path object, and produced a compact pickle representation.

With this patch, we instead return a tuple of paths that were originally given to the path constructor. This makes pickling much faster (at the expense of compactness).

It's worth noting that, in the olden times, pathlib performed this parsing/normalization up-front in every case, and so using `parts` for pickling was almost free. Nowadays pathlib only parses/normalises paths when it's necessary or advantageous to do so (e.g. computing a path parent, or iterating over a directory, respectively).
2024-04-20 17:46:52 +01:00
Savannah Ostrowski d8f350309d
GH-115874: Fix segfault in FutureIter_dealloc (GH-117741) 2024-04-19 22:30:52 +00:00
Dino Viehland 07525c9a85
gh-116818: Make `sys.settrace`, `sys.setprofile`, and monitoring thread-safe (#116775)
Makes sys.settrace, sys.setprofile, and monitoring generally thread-safe.

Mostly uses a stop-the-world approach and synchronization around the code object's _co_instrumentation_version.  There may be a little bit of extra synchronization around the monitoring data that's required to be TSAN clean.
2024-04-19 14:47:42 -07:00
Dino Viehland b45af00bad
[gh-117657] _Py_MergeZeroLocalRefcount isn't loading ob_ref_shared with strong enough semantics (#118111)
Use acquire for load of ob_ref_shared
2024-04-19 14:21:01 -07:00
Noah Kim b624490dee
Fix a typo in dictobject.c documentation (#117515) 2024-04-19 19:19:12 +00:00
Russell Keith-Magee ab99438900
gh-114099: Modify preprocessor symbol usage to support older macOS SDKs (GH-118073)
Co-authored-by: Joshua Root jmr@macports.org
2024-04-19 14:56:33 -04:00
Nikita Sobolev 2aa11cca11
gh-118100: Improve links in `ast.rst` (#118101)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2024-04-19 21:25:54 +03:00
Dino Viehland 1e4a4c4897
gh-117657: use relaxed loads for checking dict keys immortality (#118067)
Use relaxed load to check if dictkeys are immortal
2024-04-19 09:25:08 -07:00
Kirill Podoprigora 8d4a244f15
gh-118079: Fix ``requires_singlephase_init`` helper (#118081)
Before this PR tests decorated with a `requires_singlephase_init` helper
did not run because of an incorrect call to the `requires_gil_enabled`
helper.
2024-04-19 11:38:13 -04:00
Alex Waygood 1e3e7ce11e
gh-114053: Fix bad interaction of PEP-695, PEP-563 and ``get_type_hints`` (#118009)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2024-04-19 13:03:44 +00:00
lyc8503 15b3555e4a
gh-116931: Add fileobj parameter check for Tarfile.addfile (GH-117988)
Tarfile.addfile now throws an ValueError when the user passes
in a non-zero size tarinfo but does not provide a fileobj,
instead of writing an incomplete entry.
2024-04-19 11:41:51 +00:00
Rostyslav Lobov 3e7d990a09
setobject: remove out of date docstring info (GH-118048) 2024-04-19 13:33:13 +02:00
lit 7c6cc00211
gh-88035: update doc-string of `epoch` in timemodule.c (GH-118076)
Follow #88035, update doc-string of epoch in timemodule.c

The epoch is `January 1st, 1970 on all platforms`, according to
current documentation.
2024-04-19 13:28:46 +02:00
Irit Katriel 8a01fd7b9b
gh-115775: Add whatsnew entry about __static_attributes__ (GH-117909)
Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2024-04-19 12:57:31 +02:00
Savannah Ostrowski 5d54436574
gh-116935: Document that heap types need to support garbage collection (GH-118021) 2024-04-19 09:29:23 +00:00
Victor Stinner 4605a197bd
gh-117518: Clarify PyTuple_GetItem() borrowed reference in the doc (GH-117920) 2024-04-19 10:41:37 +02:00
Mark Shannon 7e6fa5fced
GH-116202: Incorporate invalidation check into _START_EXECUTOR. (GH-118044) 2024-04-19 09:26:42 +01:00
Mark Shannon d3bd6b5f3f
GH-115419: Improve list of escaping functions (GH-118054) 2024-04-19 09:25:07 +01:00
Mariusz Felisiak fefd5d9711
gh-64588: Clarify the difference between mu and xbar in statistics docs (#117333)
Thanks Davin Potts for the clarification idea.
2024-04-18 22:36:24 -07:00
dependabot[bot] 6099fdf733
build(deps): bump hypothesis from 6.98.15 to 6.100.0 in /Tools (#117416)
Bumps [hypothesis](https://github.com/HypothesisWorks/hypothesis) from 6.98.15 to 6.100.0.
- [Release notes](https://github.com/HypothesisWorks/hypothesis/releases)
- [Commits](https://github.com/HypothesisWorks/hypothesis/compare/hypothesis-python-6.98.15...hypothesis-python-6.100.0)

---
updated-dependencies:
- dependency-name: hypothesis
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-18 22:23:49 -07:00
Jelle Zijlstra 60787b8a4e
Docs: Fix CVE link (#118077) 2024-04-18 21:31:53 -07:00
Tian Gao a09e472992
gh-117535: Change unknown filename of warnings from `sys` to `<sys>` (#118018) 2024-04-18 20:50:09 -07:00
Rafael Fontenelle 398abdd6fa
Use "Contributed by" in a couple of occurrences of 3.12 whatsnew (#118070) 2024-04-19 03:28:12 +00:00
Donghee Na 710c01be94
gh-112069: Make PySet_GET_SIZE to be atomic safe. (gh-118053)
gh-112069: Make PySet_GET_SIZE to be atomic operation
2024-04-19 06:40:28 +09:00
Victor Stinner 8f25cc9920
gh-102402: Fix logging test_relativeCreated_has_higher_precision() leak (#117985)
Fix a reference leak in test_relativeCreated_has_higher_precision()
of test_logging: don't reimport the logging the logging module.
2024-04-18 19:01:55 +02:00
Serhiy Storchaka ccdcd1d95a
gh-117503: Fix test for posixpath.expanduser() when pw_dir ends with / (GH-118056) 2024-04-18 16:59:52 +00:00
Donghee Na 94444ea45a
gh-112069: Add _PySet_NextEntryRef to be thread-safe. (gh-117990) 2024-04-19 00:18:22 +09:00
Guido van Rossum 40f4d641a9
GH-118036: Fix a bug with CALL_STAT_INC (#117933)
We were under-counting calls in `_PyEvalFramePushAndInit`
because the `CALL_STAT_INC` macro was redefined to a no-op
for the Tier 2 interpreter. The fix is not to `#undef` it at all.
This results in ~37% more "Frames pushed" reported
under "Call stats".
2024-04-18 07:59:02 -07:00
Shreyan Avigyan 81a926bd20
gh-87969: Align docs and docstrings with implementation for ctypes' [w]string_at() (#25384)
The implementation uses 'ptr' for the name of the first parameter of 
ctypes.string_at() and ctypes.wstring_at(). Align docs and docstrings 
with the naming used in the implementation.

Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
2024-04-18 14:57:37 +00:00
Victor Stinner 340a02b590
gh-117987: Restore several functions removed in Python 3.13 alpha 1 (GH-117993)
Restore these functions removed in Python 3.13 alpha 1:

* Py_SetPythonHome()
* Py_SetProgramName()
* PySys_SetArgvEx()
* PySys_SetArgv()
2024-04-18 15:20:38 +02:00
lyc8503 0a0756c5ed
gh-116932: Remove redundant NEWS entry (#118040) 2024-04-18 13:22:18 +01:00
Mark Shannon e32f6e9e4b
GH-115419: Tidy up tier 2 optimizer. Merge peephole pass into main pass (GH-117997) 2024-04-18 11:09:30 +01:00
Miro Hrončok f70395786f
gh-90815: Document bundled mimalloc in What’s New In Python 3.13 (GH-117811) 2024-04-18 11:04:20 +02:00
Jens Hedegaard Nielsen 1539854c3d
fix formatting of literal in docstring of int.from_bytes and int.to_bytes (#117847) 2024-04-18 09:01:58 +00:00
lyc8503 468b9aeb92
gh-116932: Add note on how to report python documentation theme bugs (GH-117989) 2024-04-18 10:45:25 +02:00
Nikita Sobolev 17ed54bc96
Fix two typos in `typeobject.c` (#118024) 2024-04-18 08:46:05 +01:00
Kirill Podoprigora cd7cf15588
gh-118023: Fix reference leak (#118025) 2024-04-18 07:32:32 +00:00
Nice Zombies b848b944bb
gh-117641: Improve the perfornance of posixpath.commonpath() (#117652) 2024-04-18 09:26:34 +02:00
Serhiy Storchaka 6078f2033e
gh-117968: Add tests for the part of the PyRun family of the C API (GH-117982)
Co-authored-by: NGRsoftlab <78017794+NGRsoftlab@users.noreply.github.com>
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
2024-04-17 23:45:35 +03:00
neonene c1d7147c82
gh-117613: Argument Clinic: disallow defining class parameter at module level (#117950) 2024-04-17 22:43:29 +02:00
Steve Dower a4b44d39cd
gh-114539: Clarify implicit launching of shells by subprocess (GH-117996) 2024-04-17 19:32:47 +01:00
Erlend E. Aasland 353ea0b273
gh-94673: Fix compiler warning in typeobject.c (#117980) 2024-04-17 17:56:59 +00:00
mpage 0d29302155
gh-117657: Quiet erroneous TSAN reports of data races in `_PySeqLock` (#117955)
Quiet erroneous TSAN reports of data races in `_PySeqLock`

TSAN reports a couple of data races between the compare/exchange in
`_PySeqLock_LockWrite` and the non-atomic loads in `_PySeqLock_{Abandon,Unlock}Write`.
This is another instance of TSAN incorrectly modeling failed compare/exchange
as a write instead of a load.
2024-04-17 17:19:28 +00:00
mpage b6c62c79e7
gh-117657: Fix data races in the method cache in free-threaded builds (#117954)
Fix data races in the method cache in free-threaded builds

These are technically data races, but I think they're benign (to
the extent that that is actually possible). We update cache entries
non-atomically but read them atomically from another thread, and there's
nothing that establishes a happens-before relationship between the
reads and writes that I can see.
2024-04-17 09:42:56 -07:00
Serhiy Storchaka deaecb88fa
gh-80361: Fix TypeError in email.Message.get_payload() (GH-117994)
It was raised when the charset is rfc2231 encoded, e.g.:

   Content-Type: text/plain; charset*=ansi-x3.4-1968''utf-8
2024-04-17 19:31:26 +03:00
Irit Katriel c179c0e6cb
gh-117680: make _PyInstructionSequence a PyObject and use it in tests (#117629) 2024-04-17 16:42:04 +01:00
Manuel Kaufmann ae8dfd2761
Doc: Render version/language selector on Read the Docs (#116966) 2024-04-17 18:40:56 +03:00
Nice Zombies fccedbda93
gh-117977: Amend version changed annotation for os.chmod, os.chown, and os.listdir (#117978) 2024-04-17 14:59:02 +00:00