Commit graph

111367 commits

Author SHA1 Message Date
Miss Islington (bot)
e25799d27d
Add note that headers added via urllib.request.add_header are added to redirected requests (GH-30708) (#92004)
(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:26:42 -06:00
Miss Islington (bot)
e2514cb77f
Correct method name typo (GH-91970)
(cherry picked from commit c6b84a727c)

Co-authored-by: Simon de Vlieger <cmdr@supakeen.com>
2022-04-27 15:19:43 -07:00
Miss Islington (bot)
86e4bdaf49
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:18:06 -07:00
Miss Islington (bot)
777d478d12
gh-91810: Expand ElementTree.write() tests to use non-ASCII data (GH-91989)
(cherry picked from commit f60b4c3d74)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2022-04-27 09:50:25 -07:00
Victor Stinner
a36d97e3f1
gh-68966: Document mailcap deprecation in Python 3.11 (#91971)
(cherry picked from commit 80de0273c0)
2022-04-27 11:39:51 +02:00
Miss Islington (bot)
280749a8fd
Fix missing f prefix on f-strings (GH-91910)
(cherry picked from commit f882d33778)

Co-authored-by: Alexander Shadchin <alexandr.shadchin@gmail.com>
2022-04-27 00:08:05 -07:00
Serhiy Storchaka
dbe666d398
[3.10] gh-91915: Fix test_netrc on non-UTF-8 locale (GH-91918). (GH-91946)
(cherry picked from commit 36306cf786)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2022-04-26 10:50:22 +03:00
Miss Islington (bot)
3e219d3123
gh-91914: Fix test_curses on non-UTF-8 locale (GH-91919)
(cherry picked from commit f41c16bf51)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2022-04-25 22:57:57 -07:00
Miss Islington (bot)
79712c9d2e
gh-91916: Fix test_runpy on non-UTF-8 locale (GH-91920)
If use a non-builtin codec, partially implemented in Python
(e.g. ISO-8859-15), a new RecursionError (with empty error message)
can be raised while handle a RecursionError.

Testing for error message was needed to distinguish
a recursion error from arbitrary RuntimeError. After introducing
RecursionError, it became unnecessary.
(cherry picked from commit a568585069)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2022-04-25 22:26:47 -07:00
Ezio Melotti
4120bbae49
[3.10] gh-91888: add a :gh: role to the documentation (GH-91889) (#91934)
* gh-91888: Add a :gh: role to the documentation (GH-91889).

* [3.10] gh-91888: add a `:gh:` role to the documentation (GH-91889)

* Add a new :gh:`...` role for GitHub issues.

* Fix a GitHub id to use the :gh: role.

* Add Misc/NEWS entry.

* Refactoring and rephrasing.

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>.
(cherry picked from commit f7641a2ffe)

Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
2022-04-26 02:51:28 +02:00
Miss Islington (bot)
971343eb56
gh-91904: Fix setting envvar PYTHONREGRTEST_UNICODE_GUARD (GH-91905)
It always failed on non-UTF-8 locale and prevented running regrtests.
(cherry picked from commit 54d068adfb)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2022-04-25 08:03:47 -07:00
Ezio Melotti
dc31334ab1
[3.10] Update Sphinx bpo role to use redirect URI. (#91890)
* Update Sphinx bpo role to use redirect URI. (GH-32342)

* [3.10] Update Sphinx bpo role to use redirect URI. (GH-32342).
(cherry picked from commit 08cfe07950)

Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>

* Fix whitespace.
2022-04-24 23:07:51 +02:00
Miss Islington (bot)
c7e6bfd150
RE: Add more tests for inline flag "x" and re.VERBOSE (GH-91854)
(cherry picked from commit 6b45076bd6)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2022-04-23 03:16:36 -07:00
Miss Islington (bot)
0482ed7d07
gh-85864: Mark positional-only args in io docs (GH-91683)
(cherry picked from commit a3f2cf3ced)

Co-authored-by: slateny <46876382+slateny@users.noreply.github.com>
2022-04-22 17:48:13 -07:00
Miss Islington (bot)
7ade77709b
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:46 -07:00
Serhiy Storchaka
1748816e80
[3.10] gh-91575: Update case-insensitive matching in re to the latest Unicode version (GH-91580). (GH-91661)
(cherry picked from commit 1c2fcebf3c)
2022-04-22 21:44:05 +03:00
Serhiy Storchaka
080781cd49
[3.10] gh-91700: Validate the group number in conditional expression in RE (GH-91702) (GH-91831)
In expression (?(group)...) an appropriate re.error is now
raised if the group number refers to not defined group.

Previously it raised RuntimeError: invalid SRE code.
(cherry picked from commit 48ec61a89a)
2022-04-22 21:09:30 +03:00
Serhiy Storchaka
9c18d783c3
[3.10] gh-90568: Fix exception type for \N with a named sequence in RE (GH-91665) (GH-91830)
re.error is now raised instead of TypeError.
(cherry picked from commit 6ccfa31421)
2022-04-22 21:08:49 +03:00
Jelle Zijlstra
9f8b9a3506
[3.10] build(deps): bump actions/upload-artifact from 2.3.1 to 3 (GH-32227) (#91748)
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 2.3.1 to 3.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v2.3.1...v3)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>.
(cherry picked from commit b8812c9ca3)
2022-04-20 18:53:31 -07:00
Jelle Zijlstra
d8d5db5f10
[3.10] build(deps): bump actions/cache from 2.1.7 to 3.0.1 (GH-32228) (#91746)
Bumps [actions/cache](https://github.com/actions/cache) from 2.1.7 to 3.0.1.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](https://github.com/actions/cache/compare/v2.1.7...v3.0.1)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>.
(cherry picked from commit 3ace1034b8)
2022-04-20 18:53:05 -07:00
Miss Islington (bot)
886b22c4c3
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:41:12 -07:00
Jelle Zijlstra
c33524e68b
[3.10] build(deps): bump actions/checkout from 2 to 3 (GH-32226) (#91723)
Bumps [actions/checkout](https://github.com/actions/checkout) from 2 to 3.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v2...v3)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>.
(cherry picked from commit 1ba63e3a9b)
2022-04-20 07:40:36 -07:00
Steve Dower
73af4b0264
bpo-40859: Update Windows build to use xz-5.2.5 (GH-20622)
Co-authored-by: Ma Lin <animalize@users.noreply.github.com>
2022-04-20 14:30:16 +01:00
Miss Islington (bot)
923ef87c77
gh-91734: Fix ossaudio support on Solaris (GH-91735)
(cherry picked from commit 4420faf273)

Co-authored-by: Jakub Kulík <Kulikjak@gmail.com>
2022-04-20 04:06:29 -07:00
Miss Islington (bot)
88bbc5dd7a
bpo-30718: Add information about text buffering (GH-32351)
(cherry picked from commit 5101d97d0b)

Co-authored-by: slateny <46876382+slateny@users.noreply.github.com>
2022-04-20 02:00:43 -07:00
Ken Jin
942ea19cf9
Fix whitespace/indentation issues in test_sys (GH-32369) (GH-32372) 2022-04-20 13:57:30 +08:00
Miss Islington (bot)
8299e24d4c
Add link to sys.path in os lib (GH-91679)
(cherry picked from commit 692aea6f38)

Co-authored-by: slateny <46876382+slateny@users.noreply.github.com>
2022-04-19 21:17:34 -07:00
Miss Islington (bot)
f92aa4fde1
Fix awkward sentence in signal docs (GH-91508)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
(cherry picked from commit 326ae71f1d)

Co-authored-by: AJ Jordan <alex@strugee.net>
2022-04-19 18:38:15 -07:00
Miss Islington (bot)
e08d32381d
gh-87497: Document that urllib.request sends headers in camel case (GH-24661) (#91517)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
(cherry picked from commit 325d6f5035)

Co-authored-by: Alix Lourme <alix.lourme@gmail.com>
2022-04-19 18:20:03 -07:00
Miss Islington (bot)
68caef8f8e
build(deps): bump actions/setup-python from 2 to 3 (GH-31630)
Bumps [actions/setup-python](https://github.com/actions/setup-python) from 2 to 3.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](https://github.com/actions/setup-python/compare/v2...v3)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
(cherry picked from commit 74e319239b)

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-19 13:41:39 -07:00
Oleg Iarygin
e7e8a9fa4f
[3.10] gh-91118: Fix docstrings that do not honor --without-doc-strings (GH-31769) (#91662)
Co-authored-by: Éric <merwok@netwok.org>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
(cherry picked from commit a573cb2fec)

Co-authored-by: Oleg Iarygin <oleg@arhadthedev.net>
2022-04-19 13:01:09 -07:00
Victor Stinner
a885f10325
gh-91231: multiprocessing BaseManager waits 1.0 second (#91701)
Shutting down a multiprocessing BaseManager now waits for 1 second until
the process completes, rather than 0.1 second, after the process is
terminated.
2022-04-19 17:06:00 +02:00
Miss Islington (bot)
c213cccc9b
Add more tests for group names and refs in RE (GH-91695)
(cherry picked from commit 74070085da)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2022-04-19 07:33:09 -07:00
Miss Islington (bot)
b865a661e3
Doc: Fix link formatting typo (GH-91659)
(cherry picked from commit 6a7a8a740e)

Co-authored-by: slateny <46876382+slateny@users.noreply.github.com>
2022-04-19 02:33:44 -07:00
Gregory P. Smith
61570ae0bc
[3.10] gh-91676 gh-91260 unittest.IsolatedAsyncioTestCase no longer leaks its executor (GH-91680)
For things like test_asyncio.test_thread this was causing frequent
"environment modified by test" errors as the executor threads had not
always stopped running after the test was over.
2022-04-19 10:31:50 +01:00
Miss Islington (bot)
0897a0bf9c
Remove duplicate explanation (GH-91534)
(cherry picked from commit 0e6dca0193)

Co-authored-by: Gouvernathor <44340603+Gouvernathor@users.noreply.github.com>
2022-04-17 21:44:58 -07:00
Miss Islington (bot)
531f66ad62
gh-89885: Improve import example in language reference (GH-91523)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
(cherry picked from commit d5a69571f5)

Co-authored-by: slateny <46876382+slateny@users.noreply.github.com>
2022-04-17 14:34:41 -07:00
Miss Islington (bot)
e5636f3a0e
gh-91541: Fix error in example in modules tutorial (GH-91634)
(cherry picked from commit efbc668183)

Co-authored-by: 180909 <734461790@qq.com>
2022-04-17 14:30:57 -07:00
Miss Islington (bot)
2bcfe20d92
gh-90923: Improve sqlite3.Connection.execute* docs (GH-91643)
- Drop 'nonstandard'; it does not add any value
- Try to be more concise
- Make return value a little more explicit
(cherry picked from commit 017f07a229)

Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
2022-04-17 14:29:21 -07:00
Gregory P. Smith
9a458934f7
[3.10] gh-91607: Fix several test_concurrent_futures tests to actually test what they claim (GH-91600) (#91612)
* Fix test_concurrent_futures to actually test what it says.

Many ProcessPoolExecutor based tests were ignoring the mp_context
and using the default instead.  This meant we lacked proper test
coverage of all of them.

Also removes the old _prime_executor() worker delay seeding code
as it appears to have no point and causes 20-30 seconds extra
latency on this already long test.  It also interfered with some
of the refactoring to fix the above to not needlessly create their
own executor when setUp has already created an appropriate one.

* Don't import the name from multiprocessing directly to avoid confusion.

(cherry picked from commit 7fa3a5a219)

Co-authored-by: Gregory P. Smith <greg@krypto.org>
2022-04-16 13:48:11 -07:00
Miss Islington (bot)
84c279b514
gh-91595: fix the comparison of character and integer by using ord() (GH-91596)
* fix the comparison of character and integer by using ord()

* 📜🤖 Added by blurb_it.

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
(cherry picked from commit 9300b6d729)

Co-authored-by: Yu Liu <yuki.liu@utexas.edu>
2022-04-16 07:59:32 -07:00
Miss Islington (bot)
f5542ecf6d
gh-82849: revise intro to os.path.rst (GH-32232)
* revise the first paragraph of docs for os.path
* add a mention of `os.PathLike` protocol
* remove warnings rendered irrelevant by :pep:`383` and :pep:`529`

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

Co-authored-by: Jack DeVries <jdevries3133@gmail.com>
2022-04-15 21:38:11 -07:00
Miss Islington (bot)
2e1f969333
Add link to documentation translation list (GH-91560) (#91589)
(cherry picked from commit c4e8a93eb3)

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

Co-authored-by: slateny <46876382+slateny@users.noreply.github.com>
2022-04-16 04:16:05 +02:00
Miss Islington (bot)
289f27d06b
gh-88513: clarify shutil.copytree's dirs_exist_ok arg (GH-91434) (GH-91464)
* add a paragraph to document this kwarg in detail
* update docstring in the source accordingly
(cherry picked from commit f33e2c87a8)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2022-04-15 15:55:13 +02:00
Miss Islington (bot)
de7b756521
gh-70979: Fix runpy.run_path parameter name in docs (GH-32265)
Noticed while reviewing GH-30729.
(cherry picked from commit f1e989b045)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2022-04-14 18:23:20 -07:00
Miss Islington (bot)
35fef27110
Add redirects to Misc/NEWS bpo links (GH-91454) (GH-91535)
(cherry picked from commit 17dbb6bc10)

Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
2022-04-14 17:02:03 +02:00
Miss Islington (bot)
52ce75fc1e
gh-90879: Fix missing parameter for put_nowait() (GH-91514)
(cherry picked from commit 0fc3517cf4)

Co-authored-by: slateny <46876382+slateny@users.noreply.github.com>
2022-04-14 02:18:31 -07:00
Miss Islington (bot)
72114c06fd
gh-91421: Use constant value check during runtime (GH-91422) (GH-91492)
The left-hand side expression of the if-check can be converted to a
constant by the compiler, but the addition on the right-hand side is
performed during runtime.

Move the addition from the right-hand side to the left-hand side by
turning it into a subtraction there. Since the values are known to
be large enough to not turn negative, this is a safe operation.

Prevents a very unlikely integer overflow on 32 bit systems.

Fixes GH-91421.
(cherry picked from commit 0859368335)

Co-authored-by: Tobias Stoeckmann <stoeckmann@users.noreply.github.com>
2022-04-13 18:38:37 -07:00
Miss Islington (bot)
89697f7374
bpo-47260: Fix os.closerange() potentially being a no-op in a seccomp sandbox (GH-32418)
_Py_closerange() currently assumes that close_range() closes
all file descriptors even if it returns an error (other than ENOSYS).
This assumption can be wrong on Linux if a seccomp sandbox denies
the underlying syscall, pretending that it returns EPERM or EACCES.
In this case _Py_closerange() won't close any descriptors at all,
which in the worst case can be a security issue.

Fix this by falling back to other methods in case of any close_range()
error. Note that fallbacks will not be triggered on any problems with
closing individual file descriptors because close_range() is documented
to ignore such errors on both Linux[1] and FreeBSD[2].

[1] https://man7.org/linux/man-pages/man2/close_range.2.html
[2] https://www.freebsd.org/cgi/man.cgi?query=close_range&sektion=2
(cherry picked from commit 1c8b3b5d66)

Co-authored-by: Alexey Izbyshev <izbyshev@ispras.ru>
2022-04-08 11:10:38 -07:00
Miss Islington (bot)
69edc30d2b
Fix bad grammar and import docstring for split/rsplit (GH-32381) (GH-32416) 2022-04-08 12:06:19 -05:00