summaryrefslogtreecommitdiffstats
path: root/Misc
Commit message (Collapse)AuthorAgeFilesLines
* gh-95196: Disable incorrect pickling of the C implemented classmethod ↵Miss Islington (bot)2022-10-051-0/+1
| | | | | | | descriptors (GH-96383) (cherry picked from commit 77f0249308de76401bf4f3c6a057789c92f862d1) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* gh-97825: fix AttributeError when calling ↵Miss Islington (bot)2022-10-051-0/+1
| | | | | | | | subprocess.check_output(input=None) with encoding or errors args (GH-97826) * fix AttributeError, add unit test (cherry picked from commit db64fb9bbe92b212db7dd173f787ea3607ae971a) Co-authored-by: andrei kulakov <andrei.avk@gmail.com>
* gh-97639: Remove `tokenize.NL` check from `tabnanny` (GH-97640)Miss Islington (bot)2022-10-041-0/+1
| | | | | | | | | | * gh-97639: Remove `tokenize.NL` check from `tabnanny` * 📜🤖 Added by blurb_it. Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com> (cherry picked from commit 06016845dcca1d444a6db6d70ce9fe6274d551d3) Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
* [3.10] gh-97728: Argument Clinic: Fix uninitialized variable in the ↵Serhiy Storchaka2022-10-031-0/+3
| | | | | | | | 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)
* gh-97740: Fix bang in Sphinx C domain ref target syntax (GH-97741)Miss Islington (bot)2022-10-031-0/+2
| | | | | | | | | | | | * gh-97740: Fix bang in Sphinx C domain ref target syntax Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com> * Add NEWS entry for C domain bang fix Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com> (cherry picked from commit 9148c0d893c7807331fd7be0997261e289074bc5) Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
* gh-96819: multiprocessing.resource_tracker: check if length of pipe write <= ↵Miss Islington (bot)2022-10-031-0/+1
| | | | | | | | 512 (GH-96890) Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com> (cherry picked from commit 19ca114645bd8796cf4094e152b1fa9944da473d) Co-authored-by: Koki Saito <49419225+saito828koki@users.noreply.github.com>
* gh-97591: In `Exception.__setstate__()` acquire strong references before ↵Miss Islington (bot)2022-10-021-0/+2
| | | | | | | calling `tp_hash` slot (GH-97700) (cherry picked from commit d63943860974f232b5f027dc6535d25d1b4d8fc0) Co-authored-by: Ofey Chan <ofey206@gmail.com>
* gh-95588: Drop the safety claim from `ast.literal_eval` docs. (GH-95919)Miss Islington (bot)2022-10-021-0/+6
| | | | | | It was never really safe and this claim conflicts directly with the big warning in the docs about it being able to crash the interpreter. (cherry picked from commit 8baef8ae367041a5cfefb40b19c7b87e9bcb56a2) Co-authored-by: Gregory P. Smith <greg@krypto.org>
* GH-97592: Fix crash in C remove_done_callback due to evil code (GH-97660)Miss Islington (bot)2022-09-301-0/+1
| | | | | | 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>
* GH-96827: Don't touch closed loops from executor threads (GH-96837)Miss Islington (bot)2022-09-301-0/+1
| | | | | | | * When chaining futures, skip callback if loop closed. * When shutting down an executor, don't wake a closed loop. (cherry picked from commit e9d63760fea8748638f6e495b5b07bd1805c9591) Co-authored-by: Guido van Rossum <guido@python.org>
* gh-90989: Clarify some installer text (GH-97676)Steve Dower2022-09-301-0/+1
|
* [3.10] Use SyntaxError invalid range in tutorial introduction example ↵Miss Islington (bot)2022-09-301-0/+1
| | | | | | | | | | (GH-93031) (GH-97667) Use SyntaxError invalid range in tutorial introduction example (GH-93031) Use output from a 3.10+ REPL, showing invalid range, for the SyntaxError examples in the tutorial introduction page. Co-authored-by: Eddie Hebert <eddie@eddiehebert.com>
* gh-91212: Fixed flickering when the tracer is turned off (GH-95129)Miss Islington (bot)2022-09-291-0/+1
| | | | | | Fixed flickering when the tracer is turned off. (cherry picked from commit 4652093e1b816b78e9a585d671a807ce66427417) Co-authored-by: Shin-myoung-serp <relent95@naver.com>
* gh-97612: Fix shell injection in get-remote-certificate.py (GH-97613)Miss Islington (bot)2022-09-281-0/+3
| | | | | | | | | | | | | | Fix a shell code injection vulnerability in the get-remote-certificate.py example script. The script no longer uses a shell to run "openssl" commands. Issue reported and initial fix by Caleb Shortt. Remove the Windows code path to send "quit" on stdin to the "openssl s_client" command: use DEVNULL on all platforms instead. Co-authored-by: Caleb Shortt <caleb@rgauge.com> (cherry picked from commit 83a0f44ffd8b398673ae56c310cf5768d359c341) Co-authored-by: Victor Stinner <vstinner@python.org>
* gh-97616: list_resize() checks for integer overflow (GH-97617)Miss Islington (bot)2022-09-281-0/+3
| | | | | | | | | | | Fix multiplying a list by an integer (list *= int): detect the integer overflow when the new allocated length is close to the maximum size. Issue reported by Jordan Limor. list_resize() now checks for integer overflow before multiplying the new allocated length by the list item size (sizeof(PyObject*)). (cherry picked from commit a5f092f3c469b674b8d9ccbd4e4377230c9ac7cf) Co-authored-by: Victor Stinner <vstinner@python.org>
* gh-73588: Fix generation of the default name of tkinter.Checkbutton. (GH-97547)Miss Islington (bot)2022-09-271-0/+4
| | | | | | | | Previously, checkbuttons in different parent widgets could have the same short name and share the same state if arguments "name" and "variable" are not specified. Now they are globally unique. (cherry picked from commit adbed2d542a815b8175db965742211856b19b52f) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* gh-97545: Make Semaphore run faster. (GH-97549)Miss Islington (bot)2022-09-261-0/+1
| | | | | (cherry picked from commit 68c46ae68b6e0c36a12e37285fff9ce0782ed01e) Co-authored-by: Cyker Way <cykerway@gmail.com>
* gh-96848: Fix -X int_max_str_digits option parsing (GH-96988)Miss Islington (bot)2022-09-261-0/+3
| | | | | | | | Fix command line parsing: reject "-X int_max_str_digits" option with no value (invalid) when the PYTHONINTMAXSTRDIGITS environment variable is set to a valid limit. (cherry picked from commit 41351662bcd21672d8ccfa62fe44d72027e6bcf8) Co-authored-by: Victor Stinner <vstinner@python.org>
* gh-97519: Synchronize links in other copies of HISTORY OF THE SOFTWARE ↵Miss Islington (bot)2022-09-251-1/+1
| | | | | | | | | | (GH-97520) HTTP links in the "HISTORY OF THE SOFTWARE" section of Doc/license.rst were converted to HTTPS in f62ff97f31a775cc7956adeae32c14e7c85bdc15. But there were other copies of these links, which were left HTTP links. (cherry picked from commit ea4be278fa6123d1f78c1fd556d79b311cd59f96) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* gh-96052: codeop: fix handling compiler warnings in incomplete input (GH-96132)Miss Islington (bot)2022-09-251-0/+4
| | | | | | | | | Previously codeop.compile_command() emitted compiler warnings (SyntaxWarning or DeprecationWarning) and raised a SyntaxError for incomplete input containing a potentially incorrect code. Now it always returns None for incomplete input without emitting any warnings. (cherry picked from commit 426d72e7ddb0af5cf851914ac75127186dd1ff04) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* GH-85760: Fix race in calling process_exited callback too early (GH-97009)Miss Islington (bot)2022-09-221-0/+1
| | | | | (cherry picked from commit 282edd7b2a74c4dfe1bfe3c5b1d30f9c21d554d6) Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
* gh-90155: Fix bug in asyncio.Semaphore and strengthen FIFO guarantee (GH-93222)Miss Islington (bot)2022-09-221-0/+1
| | | | | | | | | | | The main problem was that an unluckily timed task cancellation could cause the semaphore to be stuck. There were also doubts about strict FIFO ordering of tasks allowed to pass. The Semaphore implementation was rewritten to be more similar to Lock. Many tests for edge cases (including cancellation) were added. (cherry picked from commit 24e03796248ab8c7f62d715c28156abe2f1c0d20) Co-authored-by: Cyker Way <cykerway@gmail.com>
* gh-97005: Update libexpat from 2.4.7 to 2.4.9 (gh-97006)Miss Islington (bot)2022-09-221-0/+1
| | | | | | 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>
* [3.10] GH-95921: Fix positions for some chained comparisons (GH-96968) ↵Brandt Bucher2022-09-201-0/+2
| | | | | | | (GH-96974) (cherry picked from commit dfc73b57247aac575c83055d960c03bdc28b51fd) Automerge-Triggered-By: GH:brandtbucher
* [3.10] GH-96864: Check for error between line and opcode events (GH-96969)Brandt Bucher2022-09-201-0/+2
| | | (cherry picked from commit c10e33ac119d96c4d88d5ae8b59e65a76ae0ad3c)
* [3.10] gh-68966: Make mailcap refuse to match unsafe filenames/types/params ↵Miss Islington (bot)2022-09-201-0/+4
| | | | | | | | | | (GH-91993) (GH-93543) * gh-68966: Make mailcap refuse to match unsafe filenames/types/params (GH-91993) (cherry picked from commit b9509ba7a9c668b984dab876c7926fe1dc5aa0ba) * Add a What's New entry for 3.10.8. Co-authored-by: Petr Viktorin <encukou@gmail.com> Co-authored-by: Gregory P. Smith <greg@krypto.org>
* gh-96387: take_gil() resets drop request before exit (GH-96869) (GH-96941)Miss Islington (bot)2022-09-201-0/+5
| | | | | | | | | | | | | | | | | | At Python exit, sometimes a thread holding the GIL can wait forever for a thread (usually a daemon thread) which requested to drop the GIL, whereas the thread already exited. To fix the race condition, the thread which requested the GIL drop now resets its request before exiting. take_gil() now calls RESET_GIL_DROP_REQUEST() before PyThread_exit_thread() if it called SET_GIL_DROP_REQUEST to fix a race condition with drop_gil(). Issue discovered and analyzed by Mingliang ZHAO. (cherry picked from commit 04f4977f508583954ad7b9cb09076ee1e57461f8) (cherry picked from commit 6ff54716f1073a4bcfed8a1ec0b518c489c1af0d) Co-authored-by: Victor Stinner <vstinner@python.org>
* gh-96821: Fix undefined behaviour in `_testcapimodule.c` (GH-96915) (GH-96926)Miss Islington (bot)2022-09-191-0/+1
| | | | | | | | | | * 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>
* gh-95778: Mention sys.set_int_max_str_digits() in error message (GH-96874)Miss Islington (bot)2022-09-161-0/+3
| | | | | | | When ValueError is raised if an integer is larger than the limit, mention sys.set_int_max_str_digits() in the error message. (cherry picked from commit e841ffc915e82e5ea6e3b473205417d63494808d) Co-authored-by: Victor Stinner <vstinner@python.org>
* gh-96678: Fix UB of null pointer arithmetic (GH-96782)Miss Islington (bot)2022-09-131-0/+1
| | | | | | Automerge-Triggered-By: GH:pablogsal (cherry picked from commit 81e36f350b75d2ed2668825f7df6e059b57f859c) Co-authored-by: Matthias Görgens <matthias.goergens@gmail.com>
* gh-96729: Ensure installers built with Tools/msi/buildrelease.bat have ↵Miss Islington (bot)2022-09-121-0/+2
| | | | | | | matching UUIDs with official releases (GH-96755) (cherry picked from commit 662782e95f97d26bd57b3edc6aaf674e30899f44) Co-authored-by: adang1345 <adang1345@gmail.com>
* GH-74116: Allow multiple drain waiters for asyncio.StreamWriter (GH-94705)Miss Islington (bot)2022-09-081-0/+1
| | | | | (cherry picked from commit e5b2453e61ba5376831093236d598ef5f9f1de61) Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
* gh-90467: StreamReaderProtocol - add strong reference to created task (GH-96323)Miss Islington (bot)2022-09-082-0/+4
| | | | | (cherry picked from commit e860e521ec0d84e175269aeb15cf24bd6053ad17) Co-authored-by: Kirill <iam@python273.pw>
* gh-96352: Set AttributeError context in _PyObject_GenericGetAttrWithDict ↵Miss Islington (bot)2022-09-081-0/+2
| | | | | | | (GH-96353) (cherry picked from commit b9634ac776c24bc4d4a57859d884a94cdfe16043) Co-authored-by: philg314 <110174000+philg314@users.noreply.github.com>
* gh-96652: Fix faulthandler chained signal without sigaction() (GH-96666)Miss Islington (bot)2022-09-081-0/+3
| | | | | | | | 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>
* gh-96577: Fixes buffer overrun in _msi module (GH-96633)Miss Islington (bot)2022-09-071-0/+1
| | | | | (cherry picked from commit 4114bcc9ef7595a07196bcecf9c7d6d39f57f64d) Co-authored-by: Steve Dower <steve.dower@python.org>
* gh-96641: Do not expose `KeyWrapper` in `_functoolsmodule.c` (gh-96642)Miss Islington (bot)2022-09-071-0/+1
| | | | | (cherry picked from commit 2fd7246e97c8cc09b4e3f22933693f9d68f08163) Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
* gh-96611: Fix error message for invalid UTF-8 in mid-multiline string (GH-96623)Miss Islington (bot)2022-09-061-0/+2
| | | | | (cherry picked from commit 05692c67c51b78a5a5a7bb61d646519025e38015) Co-authored-by: Michael Droettboom <mdboom@gmail.com>
* Merge remote-tracking branch 'upstream/3.10' into 3.10Pablo Galindo2022-09-061-0/+1
|\
| * gh-92986: Fix ast.unparse when ImportFrom.level is None (GH-92992)Miss Islington (bot)2022-09-051-0/+1
| | | | | | | | | | | | | | | | This doesn't happen naturally, but is allowed by the ASDL and compiler. We don't want to change ASDL for backward compatibility reasons (GH-57645, GH-92987) (cherry picked from commit 200c9a8da0e2b892c476807e986009c01327e781) Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
* | Python 3.10.7v3.10.7Pablo Galindo2022-09-0520-46/+205
|/
* [3.10] gh-95778: Correctly pre-check for int-to-str conversion (GH-96537) ↵Gregory P. Smith2022-09-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (#96563) Converting a large enough `int` to a decimal string raises `ValueError` as expected. However, the raise comes _after_ the quadratic-time base-conversion algorithm has run to completion. For effective DOS prevention, we need some kind of check before entering the quadratic-time loop. Oops! =) The quick fix: essentially we catch _most_ values that exceed the threshold up front. Those that slip through will still be on the small side (read: sufficiently fast), and will get caught by the existing check so that the limit remains exact. The justification for the current check. The C code check is: ```c max_str_digits / (3 * PyLong_SHIFT) <= (size_a - 11) / 10 ``` In GitHub markdown math-speak, writing $M$ for `max_str_digits`, $L$ for `PyLong_SHIFT` and $s$ for `size_a`, that check is: $$\left\lfloor\frac{M}{3L}\right\rfloor \le \left\lfloor\frac{s - 11}{10}\right\rfloor$$ From this it follows that $$\frac{M}{3L} < \frac{s-1}{10}$$ hence that $$\frac{L(s-1)}{M} > \frac{10}{3} > \log_2(10).$$ So $$2^{L(s-1)} > 10^M.$$ But our input integer $a$ satisfies $|a| \ge 2^{L(s-1)}$, so $|a|$ is larger than $10^M$. This shows that we don't accidentally capture anything _below_ the intended limit in the check. <!-- gh-issue-number: gh-95778 --> * Issue: gh-95778 <!-- /gh-issue-number --> Co-authored-by: Gregory P. Smith [Google LLC] <greg@krypto.org> (cherry picked from commit b126196838bbaf5f4d35120e0e6bcde435b0b480) Co-authored-by: Mark Dickinson <dickinsm@gmail.com>
* gh-68163: Correct conversion of Rational instances to float (GH-25619) ↵Miss Islington (bot)2022-09-041-0/+1
| | | | | | | | | | | | (GH-96557) * gh-68163: Correct conversion of Rational instances to float Also document that numerator/denominator properties are instances of Integral. Co-authored-by: Mark Dickinson <dickinsm@gmail.com> (cherry picked from commit 8464b754c4168586b99e2135ccd2567e025625a9) Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
* [3.10] gh-95778: CVE-2020-10735: Prevent DoS by very large int() (#96501)Gregory P. Smith2022-09-021-0/+14
| | | | | | | | | | | | | | | | | Integer to and from text conversions via CPython's bignum `int` type is not safe against denial of service attacks due to malicious input. Very large input strings with hundred thousands of digits can consume several CPU seconds. This PR comes fresh from a pile of work done in our private PSRT security response team repo. This backports https://github.com/python/cpython/pull/96499 aka 511ca9452033ef95bc7d7fc404b8161068226002 Signed-off-by: Christian Heimes [Red Hat] <christian@python.org> Tons-of-polishing-up-by: Gregory P. Smith [Google] <greg@krypto.org> Reviews via the private PSRT repo via many others (see the NEWS entry in the PR). <!-- gh-issue-number: gh-95778 --> * Issue: gh-95778 <!-- /gh-issue-number --> I wrote up [a one pager for the release managers](https://docs.google.com/document/d/1KjuF_aXlzPUxTK4BMgezGJ2Pn7uevfX7g0_mvgHlL7Y/edit#).
* [3.10] Clean up junk & fix typo in 3.10.6 release notes (#95997)Marti Raudsepp2022-08-301-6/+1
|
* gh-95231: Disable md5 & crypt modules if FIPS is enabled (GH-94742)Miss Islington (bot)2022-08-301-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | If kernel fips is enabled, we get permission error upon doing `import crypt`. So, if kernel fips is enabled, disable the unallowed hashing methods. Python 3.9.1 (default, May 10 2022, 11:36:26) [GCC 10.2.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import crypt Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/lib/python3.9/crypt.py", line 117, in <module> _add_method('MD5', '1', 8, 34) File "/usr/lib/python3.9/crypt.py", line 94, in _add_method result = crypt('', salt) File "/usr/lib/python3.9/crypt.py", line 82, in crypt return _crypt.crypt(word, salt) PermissionError: [Errno 1] Operation not permitted Signed-off-by: Shreenidhi Shedi <sshedi@vmware.com> (cherry picked from commit 2fa03b1b0708d5d74630c351ec9abd2aac7550da) Co-authored-by: Shreenidhi Shedi <53473811+sshedi@users.noreply.github.com>
* [3.10] gh-94682: Build and test with OpenSSL 1.1.1q (gh-94683) (gh-96391)Christian Heimes2022-08-291-0/+1
| | | Co-authored-by: Christian Heimes <christian@python.org>
* gh-95243: Mitigate the race condition in testSockName (GH-96173)Miss Islington (bot)2022-08-251-0/+3
| | | | | | | | | | | find_unused_port() has an inherent race condition, but we can't use bind_port() as that uses .getsockname() which this test is exercising. Try binding to unused ports a few times before failing. Signed-off-by: Ross Burton <ross.burton@arm.com> (cherry picked from commit df110126971d0271a977ce10779083b3e335b4da) Co-authored-by: Ross Burton <ross.burton@arm.com>
* GH-96179: Fix misleading example on the bisect documentation (GH-96228)Miss Islington (bot)2022-08-241-0/+1
| | | | | | The `movies[bisect(movies, 1960, key=by_year)]` will actually return only movies **after** 1960. (cherry picked from commit 4317b25a2323ae4be04574e45de0e335c571c463) Co-authored-by: prego <pedropregueiro@gmail.com>
* gh-96175: add missing self._localName assignment in `xml.dom.minidom.Attr` ↵Miss Islington (bot)2022-08-231-0/+1
| | | | | | | | | | (GH-96176) X-Ref: https://github.com/python/typeshed/pull/8590GH-discussion_r951473977 Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com> (cherry picked from commit 58f6953d6d3fe20d972bfa2f6e982206adcf1353) Co-authored-by: Kevin Kirsche <Kev.Kirsche+GitHub@gmail.com>