Commit Graph

111608 Commits

Author SHA1 Message Date
David Federman 734ed35383
bpo-45931: Prevent Directory.Build.props/targets from leaking from directories above the repo when building on Windows (GH-29854) 2021-11-29 22:40:34 +00:00
Kumar Aditya 02b5ac6091
bpo-45653: fix test_embed on windows (GH-29814) 2021-11-29 12:27:34 -08:00
Gideon 6266e4af87
bpo-45917: Add math.exp2() method - return 2 raised to the power of x (GH-29829)
Co-authored-by: Mark Dickinson <dickinsm@gmail.com>
2021-11-29 18:55:43 +00:00
andrei kulakov c1f93f0d37
bpo-43905: Expand dataclasses.astuple() and asdict() docs (GH-26154)
Expanded ``astuple()`` docs, warning about deepcopy being applied 
and providing a workaround.

Automerge-Triggered-By: GH:ericvsmith
2021-11-29 10:10:32 -08:00
Vinay Sajip 4141d94fa6
bpo-44391: Remove unused argument from a varargs call. (GH-29843) 2021-11-29 17:26:50 +00:00
Christian Heimes 992565f7f7
bpo-45881: configure --with-freeze-module --with-build-python (GH-29835)
Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
Co-authored-by: Ethan Smith <ethan@ethanhs.me>
2021-11-29 17:23:29 +01:00
Christian Heimes b394af13f6
bpo-45847: PY_STDLIB_MOD_SIMPLE now checks py_stdlib_not_available (GH-29844) 2021-11-29 16:34:16 +01:00
Erlend Egeberg Aasland c4a69a4ad0
bpo-45828: Use unraisable exceptions within sqlite3 callbacks (FH-29591) 2021-11-29 15:22:32 +00:00
Christian Heimes 6ac3c8a314
bpo-40280: Emscripten systems use .wasm suffix by default (GH-29842) 2021-11-29 16:01:55 +01:00
Erlend Egeberg Aasland c1dec9540a
bpo-45723: Sort the grand AC_CHECK_HEADERS check (GH-29846)
Automerge-Triggered-By: GH:tiran
2021-11-29 06:41:11 -08:00
Erlend Egeberg Aasland f7a62f2405
bpo-45847: Make socket module conditional (GH-29769) 2021-11-29 14:57:36 +01:00
Vinay Sajip 39b60ceae8
[Doc] Add info to logging cookbook about running logging socket listeners i… (GH-29838) 2021-11-29 13:06:52 +00:00
Mark Shannon 60929576e4
bpo-45786: Allocate space for frame in frame object. (GH-29729) 2021-11-29 12:34:59 +00:00
Jakub Kulík 7431448b81
bpo-43498: Fix dictionary iteration error in _ExecutorManagerThread (GH-24868) 2021-11-29 14:02:56 +02:00
Erlend Egeberg Aasland b3f443a35e
bpo-40280: Disable unusable core extension modules on emscripten (GH-29834)
Co-authored-by: Christian Heimes <christian@python.org>
2021-11-29 12:39:14 +01:00
Christian Heimes 4dc198dedd
bpo-45847: Fix _multiprocessing on platforms without sem_open (GH-29833) 2021-11-29 10:36:10 +01:00
Serhiy Storchaka 87d5180b7a
Remove misleading comment in the AST optimizer (#29825) 2021-11-29 11:19:59 +03:00
Sam Bull 934a826237
bpo-37658: Actually return result in race condition (GH-29202) 2021-11-29 10:12:57 +02:00
Christian Heimes f87ea03502
bpo-45915: use fcntl(fd, F_GETFD) in is_valid_fd() (GH-29821) 2021-11-28 19:40:27 +01:00
Erlend Egeberg Aasland aaf42222cf
bpo-45847: Port _multiprocessing to PY_STDLIB_MOD (GH-29768) 2021-11-28 13:00:51 +01:00
180909 46c8d91571
bpo-19460: Add test for MIMENonMultipart (GH-29817) 2021-11-28 11:24:41 +02:00
Irit Katriel 4dfae6f38e
bpo-45614: Fix traceback display for exceptions with invalid module name (GH-29726) 2021-11-27 22:00:10 +00:00
Pablo Galindo Salgado e71c12efcd
bpo-42268: Fail the configure step if the selected compiler doesn't support memory sanitizer (GH-29806) 2021-11-27 18:04:06 +00:00
Raymond Hettinger af9ee57b96
bpo-45876: Improve accuracy for stdev() and pstdev() in statistics (GH-29736)
* Inlined code from variance functions

* Added helper functions for the float square root of a fraction

* Call helper functions

* Add blurb

* Fix over-specified test

* Add a test for the _sqrt_frac() helper function

* Increase the tested range

* Add type hints to the internal function.

* Fix test for correct rounding

* Simplify ⌊√(n/m)⌋ calculation

Co-authored-by: Mark Dickinson <dickinsm@gmail.com>

* Add comment and beef-up tests

* Test for zero denominator

* Add algorithmic references

* Add test for the _isqrt_frac_rto() helper function.

* Compute the 109 instead of hard-wiring it

* Stronger test for _isqrt_frac_rto()

* Bigger range

* Bigger range

* Replace float() call with int/int division to be parallel with the other code path.

* Factor out division. Update proof link. Remove internal type declaration

Co-authored-by: Mark Dickinson <dickinsm@gmail.com>
2021-11-26 22:54:50 -07:00
Steve Dower db55f3faba
bpo-44530: Reverts a change to the 'code.__new__' audit event (GH-29809) 2021-11-27 00:26:45 +00:00
Ma Lin 7edb6270a7
bpo-41735: Fix thread lock in zlib.Decompress.flush() may go wrong (GH-29587)
* Fix thread lock in zlib.Decompress.flush() may go wrong

Getting `.unconsumed_tail` before acquiring the thread lock may mix up decompress state.
2021-11-26 16:18:17 -08:00
Steve Dower 4841e694ee
bpo-45901: Fixes argument passing when invoking .py files directly through the Store package (GH-29799) 2021-11-26 23:08:20 +00:00
Guido van Rossum 94daf39b2f
Fix markup buglet in Doc/howto/annotations.rst (#29802) 2021-11-26 14:10:01 -08:00
Victor Stinner 9a7611a7c4
bpo-45866: Fix typo in the NEWS entry (GH-29798) 2021-11-26 22:56:25 +01:00
Christian Heimes 4ebde73b8e
bpo-40280: Move hard-coded feature checks to configure (GH-29789)
Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
2021-11-26 19:36:48 +01:00
Kumar Aditya b0b10e146b
bpo-45019: Cleanup module freezing and deepfreeze (#29772) 2021-11-26 08:50:54 -08:00
Christian Heimes 765b2a3ad2
bpo-45886: Fix OOT build when srcdir has frozen module headers (GH-29793)
The presence of frozen module headers in srcdir interfers with OOT
build. Make considers headers in srcdir up to date, but later builds do
not use VPATH to locate files. make clean now removes the headers, too.

Also remove stale ``_bootstrap_python`` from .gitignore.
2021-11-26 17:05:16 +01:00
Christian Heimes 8caceb7a47
bpo-40280: Add configure check for socket shutdown (GH-29795) 2021-11-26 15:16:54 +01:00
Dong-hee Na db671b010c
bpo-45760: Remove PyNumber_InMatrixMultiply (GH-29751) 2021-11-26 23:10:10 +09:00
Christian Heimes d224e769b8
bpo-40280: clean and ignore .wasm files (GH-29794) 2021-11-26 14:29:46 +01:00
Victor Stinner 253b7a0a9f
bpo-45866: pegen strips directory of "generated from" header (GH-29777)
"make regen-all" now produces the same output when run from a
directory other than the source tree: when building Python out of the
source tree.
2021-11-26 11:50:34 +01:00
Christian Heimes ee1e2c604c
bpo-40280: Use Setup.stdlib static for wasm builds (GH-29784)
``Modules/Setup.stdlib`` contains ``Setup`` lines for all stdlib extension modules for which ``configure`` has detected their dependencies. The file is not used yet and still under development. To use the file, do ``ln -sfr Modules/Setup.stdlib Modules/Setup.local``.
2021-11-26 08:26:49 +01:00
Arthur Milchior cd876c8493
bpo-45619: documentation of execution model: clarify and update binding summary (#29232)
This does two changes that are quite related.

0. it add that variable binding can occur in pattern matching, an update of 3.10
which seems to have been omitted from the list of bindings
1. Given how long the sentence already was, with even subcases in the middle of
the sentence, the commit breaks the sentence into an actual list.
2021-11-25 21:19:06 -08:00
Alex Waygood 93c65df83c
bpo-44353: Correct docstring for `NewType` (#29785)
The docstring for `typing.NewType` is no longer strictly accurate, now that `NewType` is a class, rather than a function
2021-11-25 20:55:15 -08:00
Simon McVittie 97dcab7832
bpo-43137: webbrowser: Replace gvfs-open and gnome-open with "gio open" (GH-29154)
* [bpo-43137](): webbrowser: Prefer gio open over gvfs-open
    
    gvfs-open(1) was superseded by gio(1) in 2015, and removed from GNOME
    releases in 2018. Debian and its derivatives like Ubuntu currently still
    have a compatibility shim for gvfs-open, but we plan to remove it.
    
    webbrowser prefers xdg-settings and xdg-open over gvfs-open, so this
    will only have any practical effect on systems where the xdg-utils
    package is not installed.
    
    Note that we don't check for GNOME_DESKTOP_SESSION_ID before using gio.
    gio does the right thing on any desktop environment that follows
    freedesktop.org specifications, similar to xdg-settings, so it's
    unnecessary to guard in this way. GNOME_DESKTOP_SESSION_ID was deprecated
    in 2008 and removed from upstream gnome-session in 2018 (it's still
    present in Debian/Ubuntu for backward compatibility, but probably
    shouldn't be). The replacement way to detect a desktop environment is
    the XDG_CURRENT_DESKTOP environment variable, which is a colon-separated
    sequence where the first item is the current desktop environment and the
    second and subsequent items (if present) are other desktop environments
    that it resembles or is based on.
    
    Resolves: 

* [bpo-43137](): webbrowser: Never invoke gnome-open
    
    gnome-open was part of GNOME 2, which was superseded in around 2010 and
    is unmaintained. The replacement was gvfs-open, which was subsequently
    replaced by gio(1) (as used in the previous commit).

* [bpo-43137](): webbrowser: Don't run gvfs-open on GNOME
    
    gvfs-open was deprecated in 2015 and removed in 2018. The replacement
    is gio(1) (as used in a previous commit).
    
    GNOME_DESKTOP_SESSION_ID was deprecated in 2008 and removed in 2018.
    The replacement is XDG_CURRENT_DESKTOP (as mentioned in a previous
    commit).

---

To test this on a typical modern Linux system, it is necessary to disable the `xdg-settings` and `xdg-open` code paths, for example with this hack:

<details><summary>Hack to disable use of xdg-settings and xdg-open</summary>

```diff
diff --git a/Lib/webbrowser.py b/Lib/webbrowser.py
index 3244f206aa..8f6c09d1d2 100755
--- a/Lib/webbrowser.py
+++ b/Lib/webbrowser.py
@@ -459,7 +459,7 @@ def open(self, url, new=0, autoraise=True):
 def register_X_browsers():
 
     # use xdg-open if around
-    if shutil.which("xdg-open"):
+    if 0 and shutil.which("xdg-open"):
         register("xdg-open", None, BackgroundBrowser("xdg-open"))
 
     # Opens an appropriate browser for the URL scheme according to
@@ -549,7 +549,7 @@ def register_standard_browsers():
         # Prefer X browsers if present
         if os.environ.get("DISPLAY") or os.environ.get("WAYLAND_DISPLAY"):
             try:
-                cmd = "xdg-settings get default-web-browser".split()
+                cmd = "false xdg-settings get default-web-browser".split()
                 raw_result = subprocess.check_output(cmd, stderr=subprocess.DEVNULL)
                 result = raw_result.decode().strip()
             except (FileNotFoundError, subprocess.CalledProcessError, PermissionError, NotADirectoryError) :
```

</details>

I haven't attempted to assess which of the specific web browsers such as Galeon are still extant, and which ones disappeared years ago. They could almost certainly be cleaned up, but that's beyond the scope of this PR.
2021-11-25 12:49:48 -08:00
Christian Heimes 1052a39b76
bpo-40280: Add wasm cross build targets (GH-29771) 2021-11-25 21:24:40 +01:00
Christian Heimes dfcc6ff36f
bpo-33393: Update config.guess and config.sub (GH-29781) 2021-11-25 20:55:29 +01:00
Sergey Kolesnikov e0f8a3e9b9
Add missing 'await writer.drain()' call to example (GH-29162)
Automerge-Triggered-By: GH:asvetlov
2021-11-25 09:15:24 -08:00
Zbigniew Siciarz 4dd82194f4
bpo-45568: Actually use @asynccontextmanager in usage example (GH-29151)
Automerge-Triggered-By: GH:asvetlov
2021-11-25 04:30:48 -08:00
Christian Heimes dc19e86983
bpo-41498: Fix build on platforms without sigset_t (GH-29770) 2021-11-25 12:28:41 +01:00
Irit Katriel c456dfafe9
bpo-45711: use exc_value instead of exc_type to determine if exc_info is valid. Add more assertions. (GH-29627) 2021-11-25 09:41:28 +00:00
Pablo Galindo Salgado 24c10d2943
bpo-45727: Only trigger the 'did you forgot a comma' error suggestion if inside parentheses (GH-29757) 2021-11-24 22:21:23 +00:00
Christian Heimes f4afc53bf6
bpo-45893: Add missing extern C to initconfig.h (GH-29761)
Co-authored-by: Steve Dower <steve.dower@python.org>
2021-11-24 21:12:12 +01:00
Jim Crist-Harif d71c7bc733
bpo-45693: Document `port` parameter to `loop.create_server` (GH-29760)
Document the `port` parameter to `loop.create_server` in `asyncio`. In
particular, note that if `host` resolves to multiple network interfaces,
passing in `port=0` will result in a different random unused port being
used for each interface.

Automerge-Triggered-By: GH:ericvsmith
2021-11-24 11:43:57 -08:00
Kumar Aditya 256f9c4588
Fix typo in freeze_modules (#29744) 2021-11-24 11:12:03 -08:00