Commit Graph

108146 Commits

Author SHA1 Message Date
Christian Heimes 35bf8ea7be
[3.9] bpo-40998: Fix a refleak in create_filter() (GH-23365) (GH-23369)
(cherry picked from commit d1e38d4023)
2020-11-18 09:45:29 -08:00
Victor Stinner c53c3f4000
bpo-42398: Fix "make regen-all" race condition (GH-23362) (GH-23367)
Fix a race condition in "make regen-all" when make -jN option is used
to run jobs in parallel. The clinic.py script now only use atomic
write to write files. Moveover, generated files are now left
unchanged if the content does not change, to not change the file
modification time.

The "make regen-all" command runs "make clinic" and "make
regen-importlib" targets:

* "make regen-importlib" builds object files (ex: Modules/_weakref.o)
  from source files (ex: Modules/_weakref.c) and clinic files (ex:
  Modules/clinic/_weakref.c.h)
* "make clinic" always rewrites all clinic files
  (ex: Modules/clinic/_weakref.c.h)

Since there is no dependency between "clinic" and "regen-importlib"
Makefile targets, these two targets can be run in parallel. Moreover,
half of clinic.py file writes are not atomic and so there is a race
condition when "make regen-all" runs jobs in parallel using make -jN
option (which can be passed in MAKEFLAGS environment variable).

Fix clinic.py to make all file writes atomic:

* Add write_file() function to ensure that all file writes are
  atomic: write into a temporary file and then use os.replace().
* Moreover, write_file() doesn't recreate or modify the file if the
  content does not change to avoid modifying the file modification
  file.
* Update test_clinic to verify these assertions with a functional
  test.
* Remove Clinic.force attribute which was no longer used, whereas
  Clinic.verify remains useful.

(cherry picked from commit 8fba9523cf)
2020-11-18 17:11:09 +01:00
Miss Islington (bot) 994c68f586
bpo-40998: Address compiler warnings found by ubsan (GH-20929)
Signed-off-by: Christian Heimes <christian@python.org>

Automerge-Triggered-By: GH:tiran
(cherry picked from commit 07f2adedf0)

Co-authored-by: Christian Heimes <christian@python.org>
2020-11-18 08:01:48 -08:00
Miss Islington (bot) 802ff7c0d3
[3.9] bpo-41561: skip test_min_max_version_mismatch (GH-22308) (GH-23363)
skip test_min_max_version_mismatch when TLS 1.0 is not available

Signed-off-by: Christian Heimes <christian@python.org>
(cherry picked from commit ce04e7105b)


Co-authored-by: Christian Heimes <christian@python.org>

Automerge-Triggered-By: GH:tiran
2020-11-18 04:42:38 -08:00
kj 71ba5f52d2
[3.9] bpo-42332: Add weakref slot to types.GenericAlias (GH-23250) (GH-23309)
(cherry picked from commit 384b7a4bd9)
2020-11-17 14:45:08 -08:00
Irit Katriel 48a9c0eb2a
[3.9] bpo-39934: Account for control blocks in 'except' in compiler. (GH-22395) (GH-23303)
* bpo-39934: backport PR 22395 to 3.9
2020-11-17 19:31:55 +00:00
Victor Stinner 05a5d697f4
bpo-41686: Always create the SIGINT event on Windows (GH-23344) (GH-23347)
bpo-41686, bpo-41713: On Windows, the SIGINT event,
_PyOS_SigintEvent(), is now created even if Python is configured to
not install signal handlers (PyConfig.install_signal_handlers=0 or
Py_InitializeEx(0)).
2020-11-17 18:58:12 +01:00
Yurii Karabas ac472b316c
[3.9] bpo-42345: Fix three issues with typing.Literal parameters (GH-23294) (GH-23335)
Literal equality no longer depends on the order of arguments.

Fix issue related to `typing.Literal` caching by adding `typed` parameter to `typing._tp_cache` function.

Add deduplication of `typing.Literal` arguments.

(cherry picked from commit f03d318ca4)

Co-authored-by: Yurii Karabas <1998uriyyo@gmail.com>
2020-11-17 07:23:36 -08:00
Miss Islington (bot) 656d50f98d
bpo-40637: Don't test builtin PBKDF2 without builtin hashes (GH-20980)
Skip testing of pure Python PBKDF2 when one or more builtin hash module
is not available. Otherwise the import of hashlib prints noise on
stderr.

Signed-off-by: Christian Heimes <christian@python.org>
(cherry picked from commit 975022b77b)

Co-authored-by: Christian Heimes <christian@python.org>
2020-11-17 07:01:55 -08:00
Miss Islington (bot) 2c38e49dba
[3.9] bpo-42120: Remove macro defining copysign to _copysign on Windows (GH-23326) (GH-23331)
(cherry picked from commit 9cc9e27725)


Co-authored-by: Steve Dower <steve.dower@python.org>
2020-11-16 23:50:43 -08:00
Lysandros Nikolaou 2b800ef809
bpo-42374: Allow unparenthesized walrus in genexps (GH-23319) (GH-23329)
This fixes a regression that was introduced by the new parser.

(cherry picked from commit cb3e5ed071)
2020-11-17 01:38:58 +02:00
Miss Islington (bot) cf70854f10
bpo-42350: Fix Thread._reset_internal_locks() (GH-23268)
Fix the threading.Thread class at fork: do nothing if the thread is
already stopped (ex: fork called at Python exit). Previously, an
error was logged in the child process.
(cherry picked from commit 5909a494cd)

Co-authored-by: Victor Stinner <vstinner@python.org>
2020-11-16 07:17:17 -08:00
Miss Islington (bot) 7c4d8fa82a
bpo-42153 Fix link to IMAP documents in imaplib.rst (GH-23297)
The University of Washington stopped hosting the IMAP documents. Link to a rescued copy on GitHub.
(cherry picked from commit aa01011003)

Co-authored-by: Yash Shete <universeyash4@gmail.com>
2020-11-15 21:27:03 -08:00
Miss Islington (bot) ec0788c7c9
More updates to the descriptor howto guide (GH-23238) (GH-23308) 2020-11-15 18:27:56 -08:00
Miss Islington (bot) 2369759a47
bpo-42317: Improve docs of typing.get_args concerning Union (GH-23254)
(cherry picked from commit c3b9592244)

Co-authored-by: Dominik1123 <15989985+Dominik1123@users.noreply.github.com>
2020-11-15 17:52:22 -08:00
Miss Islington (bot) 2837241f22
fix typo in ThreadedChildWatcher docs (GH-23277)
(cherry picked from commit 8836574a0f)

Co-authored-by: Thomas Grainger <tagrain@gmail.com>
2020-11-14 04:24:21 -08:00
Miss Islington (bot) faadc52e75
bpo-40754: Adds _testinternalcapi to Windows installer for test suite (GH-23271)
(cherry picked from commit 9b6934230c)

Co-authored-by: Steve Dower <steve.dower@python.org>
2020-11-13 14:47:27 -08:00
Miss Islington (bot) 4defeb0071
bpo-42344: Improve pseudo implementation for SimpleNamespace (GH-23264) (GH-23270)
(cherry picked from commit bbeb2d266d)

Co-authored-by: Jürgen Gmach <juergen.gmach@googlemail.com>

Co-authored-by: Jürgen Gmach <juergen.gmach@googlemail.com>
2020-11-13 13:19:05 -05:00
Dong-hee Na 0f4dd87a31
[3.9] bpo-42042: Use ids attribute instead of names attribute (GH-22739) (GH-23265)
(cherry picked from commit 09490a109f)

Co-authored-by: Dong-hee Na <donghee.na@python.org>
2020-11-14 00:45:02 +09:00
Victor Stinner ec306a2fd9
bpo-41617: Add _Py__has_builtin() macro (GH-23260) (GH-23262)
Fix building pycore_bitutils.h internal header on old clang version
without __builtin_bswap16() (ex: Xcode 4.6.3 on Mac OS X 10.7).

Add a new private _Py__has_builtin() macro to check for availability
of a preprocessor builtin function.

Co-Authored-By: Joshua Root <jmr@macports.org>

Co-authored-by: Joshua Root <jmr@macports.org>
(cherry picked from commit b3b98082c5)
2020-11-13 16:38:06 +01:00
Miss Islington (bot) e5729aef6f
bpo-42296: On Windows, fix CTRL+C regression (GH-23257)
On Windows, fix a regression in signal handling which prevented to
interrupt a program using CTRL+C. The signal handler can be run in a
thread different than the Python thread, in which case the test
deciding if the thread can handle signals is wrong.

On Windows, _PyEval_SignalReceived() now always sets eval_breaker to
1 since it cannot test _Py_ThreadCanHandleSignals(), and
  eval_frame_handle_pending() always calls
  _Py_ThreadCanHandleSignals() to recompute eval_breaker.
(cherry picked from commit d96a7a8313)

Co-authored-by: Victor Stinner <vstinner@python.org>
2020-11-13 06:11:38 -08:00
Miss Islington (bot) bc77704783
[3.9] bpo-42086: Document AST operator nodes acts as a singleton (GH-22896) (GH-22897)
Automerge-Triggered-By: GH:gvanrossum
(cherry picked from commit b37c994e5a)


Co-authored-by: Batuhan Taskaya <batuhanosmantaskaya@gmail.com>
2020-11-13 01:05:41 -08:00
Miss Islington (bot) 7ae19ef5cf
bpo-42237: Fix os.sendfile() on illumos (GH-23154)
(cherry picked from commit fd4ed57674)

Co-authored-by: Jakub Stasiak <jakub@stasiak.at>
2020-11-12 02:14:03 -08:00
Miss Islington (bot) 33922cb0aa
bpo-42140: Improve asyncio.wait function (GH-22938)
GH- Improve asyncio.wait function

The original code creates the futures set two times.
We can create this set before, avoiding the second creation.

This new behaviour [breaks the aiokafka library](https://github.com/aio-libs/aiokafka/pull/672), because it gives an iterator to that function, so the second iteration become empty.

Automerge-Triggered-By: GH:1st1
(cherry picked from commit 7e5ef0a571)

Co-authored-by: Diogo Dutra <diogodutradamata@gmail.com>
2020-11-10 15:10:57 -08:00
Zackery Spytz f8bea0a44d
[3.9] bpo-4bpo-42314: Fix the documentation for venv --upgrade-deps (GH-22113) (GH-23232)
It was added in 3.9, not 3.8.
2020-11-10 23:06:34 +00:00
Miss Islington (bot) 14a343a9af
bpo-42014: shutil.rmtree: call onerror with correct function (GH-22585)
The onerror is supposed to be called with failed function, but in this case lstat is wrongly used instead of open.

Not sure if this needs bug or not...

Automerge-Triggered-By: GH:hynek
(cherry picked from commit e59b2deffd)

Co-authored-by: Michal Čihař <michal@cihar.com>
2020-11-10 08:29:35 -08:00
Miss Islington (bot) 90115a2cf7
bpo-42183: Fix a stack overflow error for asyncio Task or Future repr() (GH-23020)
The overflow occurs under some circumstances when a task or future
recursively returns itself.

Co-authored-by: Kyle Stanley <aeros167@gmail.com>
(cherry picked from commit 42d873c63a)

Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
2020-11-10 06:20:52 -08:00
Miss Islington (bot) 2a86ade9e3
Fix typo in unicodeobject.c (GH-23180)
exeeds -> exceeds

Automerge-Triggered-By: GH:Mariatta
(cherry picked from commit 38811d68ca)

Co-authored-by: Ikko Ashimine <eltociear@gmail.com>
2020-11-09 22:18:34 -08:00
Miss Islington (bot) 371c33567a
bpo-41754: Ignore NotADirectoryError in invocation of xdg-settings (GH-23075)
It is not clear why this can happen, but several users have mentioned
getting this exception on macOS.
(cherry picked from commit 23831a7a90)

Co-authored-by: Ronald Oussoren <ronaldoussoren@mac.com>
2020-11-08 02:07:44 -08:00
Miss Islington (bot) 2e5bd4f677
Minor wording change in concurrent.futures. (GH-23194)
Fixes a grammar problem by adding a missing "as", and clarifies the wording of the valid ranges for max_workers.
(cherry picked from commit fd6f6fa403)

Co-authored-by: Don Kirkby <donkirkby@users.noreply.github.com>
2020-11-08 01:45:45 -08:00
Miss Islington (bot) e81e09bfc8
bpo-42233: Correctly repr GenericAlias when used with typing module (GH-23081)
Noticed by @serhiy-storchaka in the bpo.  `typing`'s types were not showing the parameterized generic.
Eg. previously:
```python
>>> typing.Union[dict[str, float], list[int]]
'typing.Union[dict, list]'
```
Now:
```python
>>> typing.Union[dict[str, float], list[int]]
'typing.Union[dict[str, float], list[int]]'
```

Automerge-Triggered-By: GH:gvanrossum
(cherry picked from commit 1f7dfb277e)

Co-authored-by: kj <28750310+Fidget-Spinner@users.noreply.github.com>
2020-11-07 08:46:08 -08:00
Raymond Hettinger 4c239a3222
Minor grammar edits for the descriptor howto guide (GH-#23175) (GH-23186) 2020-11-06 16:46:10 -08:00
Miss Islington (bot) 6255296c50
Remove outdated reference to pywin32 from platform module (GH-22005)
(cherry picked from commit 7c01f1540f)

Co-authored-by: Andre Delfino <adelfino@gmail.com>
2020-11-06 11:22:00 -08:00
Miss Islington (bot) e74fb2d766
bpo-42179: Doc/tutorial: Remove mention of __cause__ (GH-23162)
(cherry picked from commit bde33e428d)

Co-authored-by: Inada Naoki <songofacandy@gmail.com>
2020-11-05 19:05:57 -08:00
Miss Islington (bot) 3997a4e6bc
Disable peg generator tests when building with PGO (GH-23141)
Otherwise, when running the testsuite, test_peg_generator tries to compile C
code using the optimized flags and fails because it cannot find the profile
data.
(cherry picked from commit 100964e031)

Co-authored-by: serge-sans-paille <serge.guelton@telecom-bretagne.eu>
2020-11-04 15:22:13 -08:00
Miss Skeleton (bot) 72bb4c6c1f
bpo-35455: Fix thread_time for Solaris OS (GH-11118) (GH-23130)
(cherry picked from commit 9568622c99)

Co-authored-by: Jakub Kulík <Kulikjak@gmail.com>

Co-authored-by: Jakub Kulík <Kulikjak@gmail.com>
2020-11-04 13:16:28 +00:00
Miss Skeleton (bot) e899c016ec
Enable signing of nuget.org packages and update to supported timestamp server (GH-23132)
(cherry picked from commit db6434c474)

Co-authored-by: Steve Dower <steve.dower@python.org>
2020-11-03 14:52:41 -08:00
Miss Skeleton (bot) 9bc07874e3
bpo-42249: Fix writing binary Plist files larger than 4 GiB. (GH-23121)
(cherry picked from commit 212d32f45c)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2020-11-03 13:32:59 -08:00
Miss Skeleton (bot) 6b7a90db36
bpo-42180: fix plural in arguments and control (GH-23015) (GH-23114)
https://bugs.python.org/issue42180
(cherry picked from commit b76a840021)

Co-authored-by: Rafael Fontenelle <rffontenelle@users.noreply.github.com>
2020-11-03 01:08:38 +00:00
Miss Skeleton (bot) e277cb7698
bpo-42103: Improve validation of Plist files. (GH-22882)
* Prevent some possible DoS attacks via providing invalid Plist files
  with extremely large number of objects or collection sizes.
* Raise InvalidFileException for too large bytes and string size instead of returning garbage.
* Raise InvalidFileException instead of ValueError for specific invalid datetime (NaN).
* Raise InvalidFileException instead of TypeError for non-hashable dict keys.
* Add more tests for invalid Plist files.
(cherry picked from commit 34637a0ce2)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2020-11-02 13:34:46 -08:00
Lysandros Nikolaou 723e21a8e7
bpo-42224: Fix test_format when locale does not expect number grouping (GH-23067)
(cherry picked from commit 301822859b)
2020-11-02 17:51:56 +02:00
Miss Skeleton (bot) ff852aabf2
bpo-42230: Improve asyncio documentation regarding accepting sets vs iterables (GH-23073)
People call wait() and as_completed() with various non-set iterables,
a list should be the most common but there are others as well[1].

Considering typeshed also documents wait()[2] and as_completed()[3]
as accepting arbitrary iterables I think it's a good idea to document
the status quo better.

[1] https://github.com/aio-libs/aiokafka/pull/672
[2] 620989bac5/stdlib/3/asyncio/tasks.pyiGH-L161
[3] 620989bac5/stdlib/3/asyncio/tasks.pyiGH-L40
(cherry picked from commit 3d86d090dc)

Co-authored-by: Jakub Stasiak <jakub@stasiak.at>
2020-11-02 03:19:45 -08:00
Miss Skeleton (bot) 27c72ba45a
Minor formatting edits to the descriptor howto guide (GH-23092) (GH-23095) 2020-11-01 20:55:57 -08:00
Miss Skeleton (bot) 79e9f06149
bpo-40511: Stop unwanted flashing of IDLE calltips (GH-20910)
They were occurring with both repeated 'force-calltip' invocations and by typing parentheses
 in expressions, strings, and comments in the argument code.

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
(cherry picked from commit da7bb7b4d7)

Co-authored-by: Tal Einat <taleinat+github@gmail.com>
2020-11-01 20:49:39 -08:00
Miss Skeleton (bot) d4cfbfe9a2
Add member objects to the descriptor howto guide (GH-23084) (GH-23090) 2020-11-01 18:27:58 -08:00
Miss Skeleton (bot) 81dd2c0914
Expand and clarify the "Invoking Descriptors" section of the Descriptor HowTo (GH-23078) (GH-23080) 2020-11-01 10:09:46 -08:00
Miss Skeleton (bot) 0312efcd2b
bpo-37483: Add PyObject_CallOneArg() in the What's New in Python 3.9 (GH-23062)
(cherry picked from commit 7feb54a634)

Co-authored-by: Dong-hee Na <donghee.na@python.org>
2020-11-01 05:27:01 -08:00
Miss Skeleton (bot) 3defcbac2c
[3.9] bpo-29566: binhex.binhex now consitently writes MacOS 9 line endings. (GH-23059) (GH-23071)
[[bpo-29566]()]() notes that binhex.binhex uses inconsistent line endings (both Unix and MacOS9 line endings are used). This PR changes this to use the MacOS9 line endings everywhere.
(cherry picked from commit 2165cea548)


Co-authored-by: Ronald Oussoren <ronaldoussoren@mac.com>

Automerge-Triggered-By: GH:ronaldoussoren
2020-11-01 01:39:26 -08:00
Lysandros Nikolaou cfcb952e30
[3.9] bpo-42218: Correctly handle errors in left-recursive rules (GH-23065) (GH-23066)
Left-recursive rules need to check for errors explicitly, since
even if the rule returns NULL, the parsing might continue and lead
to long-distance failures.

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
(cherry picked from commit 02cdfc93f8)

Automerge-Triggered-By: GH:lysnikolaou
2020-10-31 12:06:03 -07:00
kj dbaa07db67
[3.9] bpo-42198: Document __new__ for types.GenericAlias (GH-23039) (GH-23061)
(cherry picked from commit bcbf758476)
2020-10-31 08:05:36 -07:00