Commit Graph

108587 Commits

Author SHA1 Message Date
Christian Heimes ea97ebab35
bpo-1635741: Port select module to multiphase init (GH-23409) 2020-11-21 20:29:26 +01:00
Christian Heimes 035deee265
bpo-1635741: Port _posixsubprocess module to multiphase init (GH-23406) 2020-11-21 20:28:14 +01:00
Serhiy Storchaka ed1007c0d7
bpo-42425: Fix possible leak in initialization of errmap for OSError (GH-23446) 2020-11-21 19:17:46 +02:00
David CARLIER 0e62efc51e
bpo-42232: mmap module add Darwin specific madvise options. (GH-23076) 2020-11-21 03:39:56 -08:00
Serhiy Storchaka 1db76394ea
bpo-42412: Fix possible leaks and check arguments in PyType_FromModuleAndSpec() (GH-23410)
* There were leaks if Py_tp_bases is used more than once or if some call is
  failed before setting tp_bases.
* There was a crash if the bases argument or the Py_tp_bases slot is not a tuple.
* The documentation was not accurate.
2020-11-21 12:02:53 +02:00
Filipe Laíns 01a202ab6b
bpo-40550: Fix time-of-check/time-of-action issue in subprocess.Popen.send_signal. (GH-20010)
send_signal() now swallows the exception if the process it thought was still alive winds up not to exist anymore (always a plausible race condition despite the checks).

Co-authored-by: Gregory P. Smith <greg@krypto.org>
2020-11-21 01:22:08 -08:00
Devin Jeanpierre 31729366e2
bpo-40791: Make compare_digest more constant-time. (GH-20444)
* bpo-40791: Make compare_digest more constant-time.

The existing volatile `left`/`right` pointers guarantee that the reads will all occur, but does not guarantee that they will be _used_. So a compiler can still short-circuit the loop, saving e.g. the overhead of doing the xors and especially the overhead of the data dependency between `result` and the reads. That would change performance depending on where the first unequal byte occurs. This change removes that optimization.

(This is change #1 from https://bugs.python.org/issue40791 .)
2020-11-21 00:55:23 -08:00
Quentin Hibon aa3a3521ce
bpo-42419: Correct 'deprecatations' is What's New 3.9 (GH-23421) 2020-11-20 23:07:22 -05:00
ArioA 6edf06b24a
bpo-42407: Use possessive appostrophe in multiprocessing doc (GH-23400) 2020-11-20 21:37:54 -05:00
Eric Snow 9f02b479e6
bpo-36876: [c-analyzer tool] Tighten up the results and output. (GH-23431)
We also update the "ignored" file with a temporary list of all known globals.
2020-11-20 15:39:28 -07:00
Shantanu a993e901eb
bpo-28002: Roundtrip f-strings with ast.unparse better (#19612)
By attempting to avoid backslashes in f-string expressions.
We also now proactively raise errors for some backslashes we can't
avoid while unparsing FormattedValues

Co-authored-by: hauntsaninja <>
Co-authored-by: Shantanu <hauntsaninja@users.noreply.github.com>
Co-authored-by: Batuhan Taskaya <isidentical@gmail.com>
2020-11-21 00:16:42 +03:00
Raymond Hettinger 9fc319dc03
bpo-42360: Add advice to help avoid pickling issues. (GH-23305) 2020-11-20 12:49:32 -08:00
Zhang Maiyun 4c24b08cd3
Fix wrong availability for signal.SIGCHLD (#23285)
I believe this is a mistake. SIGCHLD is only available on Unix systems, not Windows.
2020-11-20 20:16:46 +02:00
Joshua Cannon 4520584483
bpo-35498: Added slice support to PathLib parents attribute. (GH-11165)
Added slice support to the `pathlib.Path.parents` sequence. For a `Path` `p`, slices of `p.parents` should return the same thing as slices of `tuple(p.parents)`.
2020-11-20 10:40:39 -05:00
Filipe Laíns d20b7ed9c1
bpo-42212: Check if generated files are up-to-date in GitHub Actions (GH-23042)
See https: //github.com/python/core-workflow/issues/380

Signed-off-by: Filipe Laíns <lains@archlinux.org>
2020-11-20 15:14:16 +01:00
Victor Stinner 3be8e220ed
bpo-42403: Use @staticmethod in importlib (GH-23395)
Use @staticmethod on methods using @classmethod but don't use their
cls parameter on the following classes:

* BuiltinImporter
* FrozenImporter
* WindowsRegistryFinder
* PathFinder

Leave methods using @_requires_builtin or @_requires_frozen unchanged,
since this decorator requires the wrapped method to have an extra parameter
(cls or self).
2020-11-20 14:44:02 +01:00
Erlend Egeberg Aasland a6109ef68d
bpo-1635741: Convert _sre types to heap types and establish module state (PEP 384) (GH-23393) 2020-11-20 21:36:23 +09:00
Mohamed Koubaa 2db8e35489
bpo-1635741: Enhance _datetime error handling (GH-23139) 2020-11-20 11:39:40 +01:00
Christian Heimes 5c36da78d7
bpo-42333: Port _ssl extension module to heap types (GH-23392)
All types in _ssl module are now heap types.
2020-11-20 09:40:12 +01:00
Christian Heimes 03c8ddd9e9
bpo-42413: socket.timeout is now an alias of TimeoutError (GH-23413)
Signed-off-by: Christian Heimes <christian@python.org>
2020-11-20 00:26:07 -08:00
Terry Jan Reedy 7ddbaa7a1b
bpo-42416: Use inspect.getdoc for IDLE calltips (GH-23416)
Inspect.getdoc(ob) sometimes gets docstrings when ob.__doc__ is None.
2020-11-20 01:59:11 -05:00
kj e1dc0db8c7
bpo-42345: Add whatsnew and versionchanged for typing.Literal in 3.9 (GH-23386)
* Whatsnew entry in 3.9 same as the one in 3.10.
* versionchanged for typing.Literal docs

Needs backport to 3.9.
2020-11-19 09:37:26 -08:00
Yurii Karabas 1b54077ff6
bpo-42345: Fix hash implementation of typing.Literal (GH-23383)
Fix hash implementation of `typing.Literal`.

Update docs regarding `typing.Litaral` caching.

Base implementation was done in PR #23294.
2020-11-19 08:17:38 -08:00
Christian Heimes b437aa83f9
bpo-1635741: Port _posixshmem extension module to multiphase initialization (GH-23404)
Signed-off-by: Christian Heimes <christian@python.org>
2020-11-19 07:20:42 -08:00
Dong-hee Na 588c7c9f08
bpo-1635741: Fix _struct for build bot error (GH-23402)
Automerge-Triggered-By: GH:tiran
2020-11-19 06:14:34 -08:00
Christian Heimes 646d7fdefb
bpo-1635741: Port gc module to multiphase initialization (GH-23377)
Signed-off-by: Christian Heimes <christian@python.org>

Automerge-Triggered-By: GH:tiran
2020-11-19 06:08:34 -08:00
Christian Heimes cfeb5437a8
bpo-1635741: Port _struct to multiphase initialization (GH-23398)
Signed-off-by: Christian Heimes <christian@python.org>
2020-11-19 22:36:23 +09:00
Victor Stinner 3390347aa0
bpo-42403: Simplify importlib external bootstrap (GH-23397)
Simplify the importlib external bootstrap code:
importlib._bootstrap_external now uses regular imports to import
builtin modules. When it is imported, the builtin __import__()
function is already fully working and so can be used to import
builtin modules like sys.
2020-11-19 13:43:43 +01:00
Victor Stinner 7d9d25dbed
bpo-42403: Fix pyflakes warnings in importlib (GH-23396)
Remove unused imports and unused local variables.
2020-11-19 11:20:57 +01:00
Christian Heimes bf9d70a1a5
bpo-1635741: Port spwd to multiphase initialization (GH-23390)
Signed-off-by: Christian Heimes <christian@python.org>
2020-11-19 10:54:03 +01:00
Christian Heimes 3094dd5fb5
bpo-1635741: Port _queue to multiphase initialization (GH-23376)
Signed-off-by: Christian Heimes <christian@python.org>

Automerge-Triggered-By: GH:tiran
2020-11-19 00:24:37 -08:00
Christian Heimes fa2eee975d
bpo-1635741: Port grp and pwd to multiphase initialization (GH-23360)
Signed-off-by: Christian Heimes <christian@python.org>
2020-11-18 23:47:32 -08:00
Christian Heimes cc0cd43c0f
bpo-1635741: Port _random to multiphase initialization (GH-23359)
Signed-off-by: Christian Heimes <christian@python.org>
2020-11-18 23:46:29 -08:00
David CARLIER 13b865f0e1
bpo-42375: subprocess DragonFlyBSD build update. (GH-23320)
Same as FreeBSD, file descriptors in /dev/fd id from 0 to 63.
2020-11-18 23:24:15 -08:00
kj 4687338d0e
bpo-42345: Add whatsnew for typing.Literal in 3.10 (GH-23385) 2020-11-18 20:44:24 -08:00
Lysandros Nikolaou a85fefe71b
bpo-42381: Document walrus-related syntax changes in whatsnew (GH-23382)
Automerge-Triggered-By: GH:lysnikolaou
2020-11-18 15:49:28 -08:00
Victor Stinner 6f4635fe20
bpo-1635741: Port _warnings to the multi-phase init (GH-23379)
Port the _warnings extension module to the multi-phase initialization
API (PEP 489).
2020-11-19 00:19:06 +01:00
Andre Delfino 829b177436
[doc] Fix smtplib and xml.dom.minidom mark-up (GH-22769) 2020-11-18 23:45:17 +01:00
Victor Stinner 6223071421
bpo-1635741: Convert _imp to multi-phase init (GH-23378)
Convert the _imp extension module to the multi-phase initialization
API (PEP 489).

* Add _PyImport_BootstrapImp() which fix a bootstrap issue: import
  the _imp module before importlib is initialized.
* Add create_builtin() sub-function, used by _imp_create_builtin().
* Initialize PyInterpreterState.import_func earlier, in
  pycore_init_builtins().
* Remove references to _PyImport_Cleanup(). This function has been
  renamed to finalize_modules() and moved to pylifecycle.c.
2020-11-18 23:18:29 +01:00
Miro Hrončok e0251787d8
bpo-39573: Remove What's new entry for Py_SIZE() (GH-23375)
A follow up for 0e2ac21dd4
2020-11-18 22:39:03 +01:00
Vladimir Matveev 7c9487ded4
bpo-42085: Add documentation for Py_TPFLAGS_HAVE_AM_SEND (GH-23374)
Updated docs to include `Py_TPFLAGS_HAVE_AM_SEND`. News section should not be necessary.

Automerge-Triggered-By: GH:asvetlov
2020-11-18 10:58:38 -08:00
Victor Stinner 0e2ac21dd4
bpo-39573: Convert Py_TYPE() and Py_SIZE() back to macros (GH-23366)
This change partically reverts
commit ad3252bad9
and the commit fe2978b3b9.

Many third party C extension modules rely on the ability of using
Py_TYPE() to set an object type: "Py_TYPE(obj) = type;" or to set an
object type using: "Py_SIZE(obj) = size;".
2020-11-18 18:48:06 +01:00
Steve Dower 2156d964a1
bpo-42336: Improve PCbuild batch files (GH-23275) 2020-11-18 17:24:36 +00:00
Christian Heimes 07f2adedf0
bpo-40998: Address compiler warnings found by ubsan (GH-20929)
Signed-off-by: Christian Heimes <christian@python.org>

Automerge-Triggered-By: GH:tiran
2020-11-18 07:38:53 -08:00
Christian Heimes 46f59ebd01
bpo-1635741: Port _hashlib to multiphase initialization (GH-23358)
Signed-off-by: Christian Heimes <christian@python.org>
2020-11-18 16:12:13 +01:00
Christian Heimes c7011012fa
bpo-1635741: Port symtable module to multiphase initialization (GH-23361)
Signed-off-by: Christian Heimes <christian@python.org>
2020-11-18 07:03:51 -08:00
Victor Stinner d1e38d4023
bpo-40998: Fix a refleak in create_filter() (GH-23365) 2020-11-18 06:57:10 -08:00
Victor Stinner 8fba9523cf
bpo-42398: Fix "make regen-all" race condition (GH-23362)
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.
2020-11-18 15:36:27 +01:00
Christian Heimes ce04e7105b
bpo-41561: skip test_min_max_version_mismatch (GH-22308)
skip test_min_max_version_mismatch when TLS 1.0 is not available

Signed-off-by: Christian Heimes <christian@python.org>
2020-11-18 13:10:53 +01:00
Erlend Egeberg Aasland ccdcb20cbe
bpo-40656: Clean up detect_socket() (GH-20148) 2020-11-17 19:08:58 -05:00