| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
| |
On macOS, fix a crash in syslog.syslog() in multi-threaded
applications. On macOS, the libc syslog() function is not
thread-safe, so syslog.syslog() no longer releases the GIL to call
it.
(cherry picked from commit d4b91663857e85eab1f309cacec4d27b5f6657ec)
Co-authored-by: Victor Stinner <vstinner@python.org>
|
|
|
|
| |
(cherry picked from commit cae7d1d7a713f8267daf5e4f2fff5cb1dad02c7c)
|
|
|
|
|
| |
(cherry picked from commit 1523c9e9d47e7d67e4889987ff0f38eb7b881fdd)
Co-authored-by: Hagai Helman Tov <hagai.helman@gmail.com>
|
|
|
|
|
| |
(cherry picked from commit 676d8ef3806758bcd1d3fd84a746c8a9b64480d0)
Co-authored-by: Stanley <46876382+slateny@users.noreply.github.com>
|
|
|
|
|
|
|
| |
(gh-97965)
(cherry picked from commit b9d2e8171696514e9226164005f7bf24bf69e66d)
Co-authored-by: Dong-hee Na <donghee.na@python.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(GH-97944) (#97967)
The macOS 13 SDK includes support for the `mkfifoat` and `mknodat` system calls.
Using the `dir_fd` option with either `os.mkfifo` or `os.mknod` could result in a
segfault if cpython is built with the macOS 13 SDK but run on an earlier
version of macOS. Prevent this by adding runtime support for detection of
these system calls ("weaklinking") as is done for other newer syscalls on
macOS.
(cherry picked from commit 6d0a0191a4e5477bd843e62c24d7f3bcad4fd5fc)
Co-authored-by: Ned Deily <nad@python.org>
|
|
|
|
|
|
|
|
| |
Py_UNICODE converter (GH-97729) (GH-97760)
It affects function os.system() on Windows and Windows-specific modules
winreg, _winapi, _overlapped, and _msi.
(cherry picked from commit 0ee9619a4cba58730c45e65d22288fadbf7680de)
|
|
|
|
|
|
| |
Evil code could cause fut_callbacks to be cleared when PyObject_RichCompareBool is called.
(cherry picked from commit 63780f4599acc2c5ee8af5f37ab76c162ad21065)
Co-authored-by: Guido van Rossum <guido@python.org>
|
|
|
|
|
|
| |
Co-authored-by: Gregory P. Smith [Google] <greg@krypto.org>
(cherry picked from commit 10e3d398c31cc1695752fc52bc6ca2ce9ef6237e)
Co-authored-by: Dong-hee Na <donghee.na@python.org>
|
|
|
|
|
|
|
|
|
|
| |
* gh-96821: Assert for demonstrating undefined behaviour
* Fix UB
(cherry picked from commit cbdeda8ce7a3543cb3376d70e4cd46fcf24f42a7)
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
Co-authored-by: Matthias Görgens <matthias.goergens@gmail.com>
|
|
|
|
|
|
|
|
| |
Fix the faulthandler implementation of faulthandler.register(signal,
chain=True) if the sigaction() function is not available: don't call
the previous signal handler if it's NULL.
(cherry picked from commit c580a81af91af4b9df85e466f8b48c3c9c86c3df)
Co-authored-by: Victor Stinner <vstinner@python.org>
|
|
|
|
|
| |
(cherry picked from commit 2fd7246e97c8cc09b4e3f22933693f9d68f08163)
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
|
|
|
|
|
| |
(cherry picked from commit 0ace820bec8892d621a4aadc1feb6c56e25560bf)
Co-authored-by: Ansab Gillani <56605828+ansabgillani@users.noreply.github.com>
|
|
|
|
|
| |
(cherry picked from commit 8b34e914bba2ccd6ae39609410db49d0beb19cb1)
Co-authored-by: Christian Heimes <christian@python.org>
|
|
|
|
|
|
|
| |
It updates links which redirect to HTTPS with different authority or
path.
(cherry picked from commit d0d0154443cafb2f0a2cdfb6a1267d80cce8388e)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
|
|
|
|
| |
(cherry picked from commit 2e7e3c4c109928870c1e33d8af36b78e92895594)
Co-authored-by: Thomas Klausner <tk@giga.or.at>
|
|
|
|
|
| |
(cherry picked from commit 4dd099bafff14639ef5d2185965016d8f253353f)
Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
|
|
|
|
|
|
| |
Automerge-Triggered-By: GH:pablogsal
(cherry picked from commit deacf391d7a1b3ab49bffa16088b3500fdb4c435)
Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
|
|
|
|
|
|
|
| |
(GH-95264)
(cherry picked from commit b1f648efc56ff17e18ec2b7402d59a771b305004)
Co-authored-by: Noam Cohen <noam@noam.me>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* syslog_get_argv() swallows exceptions, but not in all cases.
* if ident is non UTF-8 encodable, syslog.openlog() fails after setting the
global reference to ident. Now the C string saved internally in the previous
call to openlog() points to the freed memory.
* PySys_Audit() can crash if ident is NULL.
* There may be a race condition with syslog.syslog(), because the global
reference to ident is decrefed before setting the new value.
* Possible use of freed memory if syslog.openlog() is called while
the GIL is released in syslog.syslog().
(cherry picked from commit 68c555a50a2b74731b0db0f4dcbf51b2c11d4853)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
|
|
|
|
|
|
|
|
|
| |
The wrapper macros are more readable and match the form recommended in
the OpenSSL documentation. They also slightly less error-prone, as the
mapping of arguments to SSL_CTX_ctrl is not always clear. (Though in
this case it's straightforward.)
https://www.openssl.org/docs/man1.1.1/man3/SSL_CTX_get_max_proto_version.html
(cherry picked from commit 936f71e5d4f50f2238b0320d44f7fb5f88e39809)
Co-authored-by: David Benjamin <davidben@davidben.net>
|
|
|
|
|
|
|
|
| |
(GH-94931) (GH-94963)
(cherry picked from commit 067f0da33506f70c36a67d5f3d8d011c8dae10c9)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
|
|
|
|
|
|
| |
(GH-94891)
(cherry picked from commit f36589510b8708fa224d799d5b328deab558aa4e)
Co-authored-by: Brandt Bucher <brandtbucher@microsoft.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When binding a unix socket to an empty address on Linux, the socket is
automatically bound to an available address in the abstract namespace.
>>> s = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
>>> s.bind("")
>>> s.getsockname()
b'\x0075499'
Since python 3.9, the socket is bound to the one address:
>>> s.getsockname()
b'\x00'
And trying to bind multiple sockets will fail with:
Traceback (most recent call last):
File "/home/nsoffer/src/cpython/Lib/test/test_socket.py", line 5553, in testAutobind
s2.bind("")
OSError: [Errno 98] Address already in use
Added 2 tests:
- Auto binding empty address on Linux
- Failing to bind an empty address on other platforms
Fixes f6b3a07b7df6 (bpo-44493: Add missing terminated NUL in sockaddr_un's length (GH-26866)
(cherry picked from commit c22f134211743cd5ad14cec1dd4f527bee542b4c)
Co-authored-by: Nir Soffer <nsoffer@redhat.com>
|
|
|
|
|
|
|
|
|
| |
multiple times (GH-30274) (#94748)
(cherry picked from commit 86c1df18727568758cc329baddc1836e45664023)
Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
* fix allocator and deallocator
* 📜🤖 Added by blurb_it.
* code review
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
(cherry picked from commit f5b76330cfb93e1ad1a77c71dafe719f6a808cec)
Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
|
|
|
|
|
| |
(cherry picked from commit 78307c7dc2352b6633138466debd4c10fae32970)
Co-authored-by: Christian Heimes <christian@python.org>
|
|
|
|
|
| |
(cherry picked from commit fb6dccae348b954d9f625031b54711a9a33da525)
Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@protonmail.com>
|
|
|
|
|
| |
(cherry picked from commit 277f55cb04409ccdf651d43df5eb9dcb3ee3128c)
Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
|
|
|
|
|
|
| |
(GH-94511) (#94579)
Co-authored-by: Łukasz Langa <lukasz@langa.pl>.
Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
|
|
|
|
| |
(GH-94298) (#94385)
|
|
|
|
|
| |
(cherry picked from commit 17ed560fcd0a1442485f9bd48884bbe412f35abc)
Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
|
|
|
|
|
|
|
| |
Also add adapters and converter recipes.
Co-authored-by: CAM Gerlach <CAM.Gerlach@Gerlach.CAM>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com.
(cherry picked from commit bd3c1c187e0e4fde5aec6835d180e9eddde8ceb6)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* gh-94207: Fix struct module leak (GH-94239)
Make _struct.Struct a GC type
This fixes a memory leak in the _struct module, where as soon
as a Struct object is stored in the cache, there's a cycle from
the _struct module to the cache to Struct objects to the Struct
type back to the module. If _struct.Struct is not gc-tracked, that
cycle is never collected.
This PR makes _struct.Struct GC-tracked, and adds a regression test.
(cherry picked from commit 6b865349aae47b90f9ef0b98f3fe3720c2f05601)
Co-authored-by: Mark Dickinson <dickinsm@gmail.com>
|
|
|
|
|
|
| |
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
(cherry picked from commit ca308c13daa722f3669a14f1613da768086beb6a)
Co-authored-by: fikotta <81991278+fikotta@users.noreply.github.com>
|
|
|
|
|
|
|
|
| |
Fixes GH-94101
Automerge-Triggered-By: GH:tiran
(cherry picked from commit dc8e1d0390e16e90b2f74f6bd6417324a357bc23)
Co-authored-by: chgnrdv <52372310+chgnrdv@users.noreply.github.com>
|
|
|
|
|
| |
(cherry picked from commit 0709586744ec58dd60492e16b08fff6dc1149a0a)
Co-authored-by: Thomas A Caswell <tcaswell@gmail.com>
|
|
|
|
|
| |
(cherry picked from commit 774ef28814d0d9d57ec813cb31b0a7af6c476127)
Co-authored-by: Christian Heimes <christian@python.org>
|
|
|
|
|
|
|
|
| |
(GH-93926) (#94011)
Co-authored-by: CAM Gerlach <CAM.Gerlach@Gerlach.CAM>.
(cherry picked from commit 6446592c89b0c581c00e170ae6278291e940755c)
Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
|
|
|
|
|
|
|
|
|
|
|
| |
The fix involves using pysqlite_check_remaining_sql(), not only to check
for multiple statements, but now also to strip leading comments and
whitespace from SQL statements, so we can improve DML query detection.
pysqlite_check_remaining_sql() is renamed lstrip_sql(), to more
accurately reflect its function, and hardened to handle more SQL comment
corner cases.
(cherry picked from commit 46740073ef32bf83964c39609c7a7a4772c51ce3)
|
|
|
|
|
| |
(cherry picked from commit 4c496f1f115a7910d4606b4de233d14874c77bfa)
Co-authored-by: Dennis Sweeney <36520290+sweeneyde@users.noreply.github.com>
|
|
|
|
|
| |
case-folding (GH-93674)
Co-authored-by: AN Long <aisk@users.noreply.github.com>
|
|
|
|
|
|
|
| |
Use C APIs such as PyModule_AddType instead of PyModule_AddObject.
Also remove incorrect module decrefs if module fails to initialise.
(cherry picked from commit a87c9b538fbfc42883417c4d5e69f1a5922690e3)
Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@protonmail.com>
|
|
|
|
|
| |
(GH-93526) (GH-93599)
(cherry picked from commit 875de61)
|
| |
|
|
|
|
|
| |
(cherry picked from commit 702e0da000bf28aa20cb7f3893b575d977506495)
Co-authored-by: Dennis Sweeney <36520290+sweeneyde@users.noreply.github.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The `utc_to_seconds` call can fail, here's a minimal reproducer on
Linux:
TZ=UTC python -c "from datetime import *; datetime.fromtimestamp(253402300799 + 1)"
The old behavior still raised an error in a similar way, but only
because subsequent calculations happened to fail as well. Better to fail
fast.
This also refactors the tests to split out the `fromtimestamp` and
`utcfromtimestamp` tests, and to get us closer to the actual desired
limits of the functions. As part of this, we also changed the way we
detect platforms where the same limits don't necessarily apply (e.g.
Windows).
As part of refactoring the tests to hit this condition explicitly (even
though the user-facing behvior doesn't change in any way we plan to
guarantee), I noticed that there was a difference in the places that
`datetime.utcfromtimestamp` fails in the C and pure Python versions, which
was fixed by skipping the "probe for fold" logic for UTC specifically —
since UTC doesn't have any folds or gaps, we were never going to find a
fold value anyway. This should prevent some failures in the pure python
`utcfromtimestamp` method on timestamps close to 0001-01-01.
There are two separate news entries for this because one is a
potentially user-facing change, the other is an internal code
correctness change that, if anything, changes some error messages. The
two happen to be coupled because of the test refactoring, but they are
probably best thought of as independent changes.
Fixes GH-91581
(cherry picked from commit 83c0247d47b99f4571e35ea95361436e1d2a61cd)
Co-authored-by: Paul Ganssle <1377457+pganssle@users.noreply.github.com>
|
|
|
|
|
|
| |
* [3.10] bpo-46785: Fix race condition between os.stat() and unlink on Windows (GH-31858).
(cherry picked from commit 39e6b8ae6a5b49bb23746fdcc354d148ff2d98e3)
Co-authored-by: Itai Steinherz <itaisteinherz@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
(#92274)
* [3.10] gh-80254: Disallow recursive usage of cursors in `sqlite3` converters (#29054)
(cherry picked from commit f629dcfe835e349433e4c5099381d668e8fe69c8)
Co-authored-by: Sergey Fedoseev <fedoseev.sergey@gmail.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
* Fix ref leak in pysqlite_cursor_iternext
|
|
|
|
|
|
|
|
|
|
|
| |
Fix a crash in subinterpreters related to the garbage collector. When
a subinterpreter is deleted, untrack all objects tracked by its GC.
To prevent a crash in deallocator functions expecting objects to be
tracked by the GC, leak a strong reference to these objects on
purpose, so they are never deleted and their deallocator functions
are not called.
(cherry picked from commit 14243369b5f80613628a565c224bba7fb3fcacd8)
Co-authored-by: Victor Stinner <vstinner@python.org>
|