Commit graph

10798 commits

Author SHA1 Message Date
Miss Islington (bot)
04cc427025
[3.9] gh-101283: Improved fallback logic for subprocess with shell=True on Windows (GH-101286) (#101709)
Co-authored-by: Oleg Iarygin <oleg@arhadthedev.net>
Co-authored-by: Steve Dower <steve.dower@microsoft.com>
2023-02-09 10:59:40 +01:00
Miss Islington (bot)
c33aaa9d55
gh-101422: (docs) TarFile default errorlevel argument is 1, not 0 (GH-101424)
(cherry picked from commit ea232716d3)

Co-authored-by: Owain Davies <116417456+OTheDev@users.noreply.github.com>
2023-01-30 10:21:08 -08:00
Gregory P. Smith
cf71e19297
[3.9] Correct CVE-2020-10735 documentation (GH-100306). (#100697)
(cherry picked from commit 1cf3d78c92)
(cherry picked from commit 88fe8d701a)

Co-authored-by: Jeremy Paige <ucodery@gmail.com>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
2023-01-20 23:20:32 +01:00
Miss Islington (bot)
e8f61ede93
Clarify that every thread has its own default context in contextvars (GH-99246)
(cherry picked from commit cb60b6131b)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
2022-12-20 03:57:08 -08:00
Miss Islington (bot)
3b81c13ac3
[3.9] gh-100001: Omit control characters in http.server stderr logs. (GH-100002) (#100032)
* gh-100001: Omit control characters in http.server stderr logs. (GH-100002)

Replace control characters in http.server.BaseHTTPRequestHandler.log_message with an escaped \xHH sequence to avoid causing problems for the terminal the output is printed to.
(cherry picked from commit d8ab0a4dfa)

Co-authored-by: Gregory P. Smith <greg@krypto.org>

* also escape \s (backport of PR #100038).

* add versionadded and remove extra 'to'

Co-authored-by: Gregory P. Smith <greg@krypto.org>
2022-12-06 11:22:12 +01:00
Miss Islington (bot)
c59a16e2c7
[3.9] gh-68966: Make mailcap refuse to match unsafe filenames/types/params (GH-91993) (#98190)
gh-68966: Make mailcap refuse to match unsafe filenames/types/params (GH-91993)
(cherry picked from commit b9509ba7a9)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
2022-10-11 23:13:18 +02:00
Miss Islington (bot)
1db2d95284
[3.9] gh-91708: Revert params note in urllib.parse.urlparse table (GH-96699) (#98054)
Revert params note in urllib.parse.urlparse table
(cherry picked from commit eed80458e8)

Co-authored-by: Stanley <46876382+slateny@users.noreply.github.com>
2022-10-07 13:53:39 -07:00
Victor Stinner
41188134bd
[3.9] gh-95778: Mention sys.set_int_max_str_digits() in error message (#96874) (#96877)
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 e841ffc915)

Co-authored-by: Ned Deily <nad@python.org>
2022-10-04 10:05:45 -07:00
Miss Islington (bot)
94dbdbbd40
[3.9] gh-87597: Document TimeoutExpired.stdout & .stderr types (GH-97685) (GH-97688)
This documents the behavior that has always been the case since timeout
support was introduced in Python 3.3.
(cherry picked from commit b05dd79649)

Co-authored-by: Gregory P. Smith <greg@krypto.org>
2022-10-04 09:59:07 -07:00
Jason R. Coombs
71edddea86
[3.9] gh-96845: Fix docs around importlib.abc.Traversable (GH-97515) (GH-97761)
Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
2022-10-04 09:58:34 -07:00
Gregory P. Smith
cec1e9dfd7
[3.9] gh-95778: CVE-2020-10735: Prevent DoS by very large int() (#96502)
* Correctly pre-check for int-to-str conversion (#96537)

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>
Co-authored-by: Christian Heimes <christian@python.org>
Co-authored-by: Mark Dickinson <dickinsm@gmail.com>
2022-09-05 11:21:03 +02:00
Miss Islington (bot)
224cd0c3bf
gh-81054: Document that SimpleHTTPRequestHandler follows symbolic links (GH-94416) (GH-94494)
(cherry picked from commit 80aaeabb8b)

Co-authored-by: Sam Ezeh <sam.z.ezeh@gmail.com>
2022-07-01 18:41:54 +02:00
Miss Islington (bot)
a43f4e7487
bpo-46879: Fix incorrect sphinx object names in doc (GH-31615) (GH-92976)
(cherry picked from commit 2cdd57f119)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
Co-authored-by: Martin Fischer <martin@push-f.com>
2022-05-19 18:03:55 +02:00
Miss Islington (bot)
3bc3c89612
gh-92417: Update docs and examples of doctest.IGNORE_EXCEPTION_DETAIL for Py>=3 (GH-92502) (GH-92964)
(cherry picked from commit 97b9c1096f)
2022-05-19 17:21:23 +02:00
Miss Islington (bot)
1aafad1909
gh-92611: Link to PEP 594 sections & add key detail in doc deprecation notices (GH-92612)
(cherry picked from commit 9f68dab3d3)

Co-authored-by: CAM Gerlach <CAM.Gerlach@Gerlach.CAM>
2022-05-13 13:13:02 -07:00
thueringa
256c6d05e2
Fix typo in argparse docs. (GH-92691) (#92731) 2022-05-13 09:01:30 -05:00
Jelle Zijlstra
f6bd1bd19a
[3.9] gh-92436: __future__ docs: add note on expectations for "from __future__ import annotations" (GH-92568). (#92726)
(cherry picked from commit 6582c96454)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2022-05-12 14:12:28 -07:00
Miss Islington (bot)
3f2113dd08
[3.9] Fix typo in unittest.rst: addCleanupModule -> addModuleCleanup (GH-92631) (GH-92661)
(cherry picked from commit 38486ca212)


Co-authored-by: Mikhail Terekhov <termim@gmail.com>

Automerge-Triggered-By: GH:serhiy-storchaka
2022-05-11 03:50:00 -07:00
Miss Islington (bot)
7534c50985
[3.9] gh-76773: Update docs mentioning no-longer-supported Windows versions & features (GH-92529) (GH-92610)
(cherry picked from commit f1bbcba74f)


Co-authored-by: CAM Gerlach <CAM.Gerlach@Gerlach.CAM>

Automerge-Triggered-By: GH:serhiy-storchaka
2022-05-10 02:28:24 -07:00
Miss Islington (bot)
b7a87861de
bpo-13553: Document tkinter.Tk args (GH-4786)
(cherry picked from commit c56e2bb994)

Co-authored-by: Cheryl Sabella <cheryl.sabella@gmail.com>
2022-05-09 21:20:37 -07:00
Miss Islington (bot)
ad82e1244e
gh-92417: asyncio docs: asyncio.run() is available on all supported Python versions (GH-92419)
(cherry picked from commit f4e317b304)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2022-05-09 09:49:25 -07:00
Miss Islington (bot)
03aa75221b
bpo-38056: overhaul Error Handlers section in codecs documentation (GH-15732)
* Some handlers were wrongly described as text-encoding only, but actually they can also be used in text-decoding.
* Add more description to each handler.
* Add two REPL examples.
* Add indexes for Error Handler's name.

Co-authored-by: Kyle Stanley <aeros167@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
(cherry picked from commit 5bc2390229)

Co-authored-by: Ma Lin <animalize@users.noreply.github.com>
2022-05-08 20:20:07 -07:00
Miss Islington (bot)
bf5fc2adb7
pdb docs: workaround for double semicolon in strings (GH-17011)
see https://github.com/gotcha/ipdb/issues/172

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
(cherry picked from commit 2888b1107f)

Co-authored-by: Godefroid Chapelle <gotcha@bubblenet.be>
2022-05-08 16:44:33 -07:00
Miss Islington (bot)
580163d6a9
gh-92417: logging docs: Remove warning that only applies to Python <3.2 (GH-92425)
(cherry picked from commit 318c4e91ef)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2022-05-08 09:07:49 -07:00
Miss Islington (bot)
baed0c31ee
[3.9] gh-92417: json docs: dict is ordered on all supported Python versions (GH-92422) (GH-92466)
(cherry picked from commit bc098cfdb7)


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

Automerge-Triggered-By: GH:serhiy-storchaka
2022-05-08 08:30:08 -07:00
Miss Islington (bot)
bab6954482
[3.9] gh-77630: Change Charset to charset (GH-92439) (GH-92477)
(cherry picked from commit 8f29318079)


Co-authored-by: slateny <46876382+slateny@users.noreply.github.com>

Automerge-Triggered-By: GH:serhiy-storchaka
2022-05-08 08:28:18 -07:00
Miss Islington (bot)
0cd0d6bf48
[3.9] gh-92417: stdtypes docs: delete discussion of Python 2 differences (GH-92423) (GH-92474)
Given that 2.7 has now been end-of-life for two and a half years,
I don't think we need such a detailed explanation here anymore of
the differences between Python 2 and Python 3.
(cherry picked from commit 8efda1e7c6)


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

Automerge-Triggered-By: GH:serhiy-storchaka
2022-05-08 08:26:50 -07:00
Miss Islington (bot)
731e844b17
gh-92417: typing docs: from __future__ import annotations can be used in all supported Python versions (GH-92418)
(cherry picked from commit e5b4bd4d60)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2022-05-08 08:04:06 -07:00
Miss Islington (bot)
d82a769a1d
gh-92223: Remove pre-Python 3.7 alternative in asyncio docs (GH-92224)
(cherry picked from commit d1b2e989be)

Co-authored-by: Sebastian Rittau <srittau@rittau.biz>
2022-05-04 17:36:04 -07:00
Jelle Zijlstra
187cb95088
[3.9] Improve the typing docs (GH-92264) (#92271)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>.
(cherry picked from commit 27e3665715)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2022-05-03 16:41:47 -06:00
Jelle Zijlstra
92d2615d00
[3.9] bpo-46586: Fix more erroneous doc links to builtins (GH-31429) (#92199)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Éric <merwok@netwok.org>.
(cherry picked from commit cc6ae4f483)

Co-authored-by: Meer Suri <46469858+meersuri@users.noreply.github.com>
2022-05-03 06:08:55 -06:00
Miss Islington (bot)
3fe4e4602d
bpo-6686: Replace String with Bytes in xml.sax.handler documentation (GH-30612)
(cherry picked from commit 32e4f450af)

Co-authored-by: Yassir Karroum <ukarroum17@gmail.com>
2022-05-02 15:45:55 -07:00
Thaddeus1499
e48da72647
[3.9] Remove effbot urls (GH-26308). (#92162)
(cherry picked from commit e9f66aedf4)

Co-authored-by: E-Paine <63801254+E-Paine@users.noreply.github.com>
2022-05-02 12:22:05 -06:00
Miss Islington (bot)
d113674b3e
gh-91783: Document security considerations for shutil.unpack_archive (GH-91844)
(cherry picked from commit 4b297a9ffd)

Co-authored-by: Sam Ezeh <sam.z.ezeh@gmail.com>
2022-05-02 10:36:05 -07:00
Miss Islington (bot)
9b7cdfdf35
gh-88546: glob.glob docs: Make new paragraph for emphasis and reordered sentence (GH-91614)
(cherry picked from commit b9ab6cea08)

Co-authored-by: slateny <46876382+slateny@users.noreply.github.com>
2022-05-02 08:33:39 -07:00
Miss Islington (bot)
0c011cc6c2
asyncio.subprocess: Fix a typo in doc (GH-92030)
Remove a confusion for read method in asyncio-subprocess doc for stderr StreamReader instance
(cherry picked from commit bb857a96ef)

Co-authored-by: Harsh <65716674+Harsh-br0@users.noreply.github.com>
2022-05-02 08:20:25 -07:00
Miss Islington (bot)
5a0f3ae22f
gh-85133: os docs: Add that getenv uses os.environ (GH-91874)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
(cherry picked from commit b25352a5c0)

Co-authored-by: slateny <46876382+slateny@users.noreply.github.com>
2022-05-02 08:08:40 -07:00
Miss Islington (bot)
cafcb2cdca
gh-84714: Add behavior if dst file exists (GH-91867)
(cherry picked from commit 9166ace805)

Co-authored-by: slateny <46876382+slateny@users.noreply.github.com>
2022-05-02 07:54:12 -07:00
slateny
28cd98f352
[3.9] gh-81488: Add recursive wording for issubclass docs (GH-92087) (#92131)
(cherry picked from commit 1066ecb970)

Co-authored-by: slateny <46876382+slateny@users.noreply.github.com>
2022-05-02 08:36:19 -06:00
Miss Islington (bot)
fcbff77b26
typing docs: Add example for async functions (GH-20386)
Fixes python/typingGH-424
(cherry picked from commit 9588f880a2)

Co-authored-by: Sam Bull <aa6bs0@sambull.org>
2022-04-30 21:59:26 -07:00
Miss Islington (bot)
cef3a994c7
gh-91611: Use example.com for documentation, not mydomain.com (GH-91613)
example.com is reserved by the IANA as special-use domain name for documentation
purposes. The domain names are used widely in books, tutorials, sample network
configurations, and generally as examples for the use of domain name.

On the other hand, mydomain.com is real Domain Name Registration service.
(cherry picked from commit ea39246782)

Co-authored-by: Motoki Naruse <motoki@naru.se>
2022-04-30 21:02:51 -07:00
Miss Islington (bot)
2e84e97656
gh-87801: Add run() to subprocess.CalledProcessError description (GH-91628)
(cherry picked from commit 567be058b4)

Co-authored-by: slateny <46876382+slateny@users.noreply.github.com>
2022-04-30 14:54:58 -07:00
Miss Islington (bot)
2830543247
gh-87192: Update wording for fcntl 'Changed in' (GH-91658)
(cherry picked from commit d7eb1ffbe8)

Co-authored-by: slateny <46876382+slateny@users.noreply.github.com>
2022-04-30 14:45:02 -07:00
Miss Islington (bot)
2c859e3d58
gh-85864: io docs: Add missing position-only parameters (GH-91950)
(cherry picked from commit 3a8e2b6e65)

Co-authored-by: slateny <46876382+slateny@users.noreply.github.com>
2022-04-30 08:42:55 -07:00
Miss Islington (bot)
0e16105af6
Add note that headers added via urllib.request.add_header are added to redirected requests (GH-30708) (#92005)
(cherry picked from commit f348154c8f)

Co-authored-by: Ashwin Ramaswami <aramaswamis@gmail.com>

Co-authored-by: Ashwin Ramaswami <aramaswamis@gmail.com>
2022-04-27 16:28:10 -06:00
Miss Islington (bot)
35a4eb299a
gh-84459: Make wording more specific for Path.replace (GH-91853)
GH-84459
(cherry picked from commit 161dff7e10)

Co-authored-by: slateny <46876382+slateny@users.noreply.github.com>
2022-04-27 15:20:53 -07:00
Miss Islington (bot)
24ce12366f
gh-68966: Document mailcap deprecation in Python 3.11 (GH-91971)
(cherry picked from commit 80de0273c0)
(cherry picked from commit a36d97e3f1)

Co-authored-by: Victor Stinner <vstinner@python.org>
2022-04-27 02:59:32 -07:00
Jelle Zijlstra
e4f5bff140
[3.9] gh-85864: Mark positional-only args in io docs (GH-91683). (#91848)
(cherry picked from commit a3f2cf3ced)

Co-authored-by: slateny <46876382+slateny@users.noreply.github.com>
2022-04-23 10:29:45 -07:00
Miss Islington (bot)
42a158b627
gh-91547: Remove "Undocumented modules" page (GH-91682)
(cherry picked from commit 254aaa7981)

Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
2022-04-22 16:33:38 -07:00
Miss Islington (bot)
342b4b0648
bpo-23747: Enhance platform doc, document default behavior (GH-31462)
(cherry picked from commit ad3ca17ff5)

Co-authored-by: slateny <46876382+slateny@users.noreply.github.com>
2022-04-20 09:48:04 -07:00