summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* bpo-45619: documentation of execution model: clarify and update binding ↵Arthur Milchior2021-11-261-9/+19
| | | | | | | | | | | 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.
* bpo-44353: Correct docstring for `NewType` (#29785)Alex Waygood2021-11-261-1/+1
| | | The docstring for `typing.NewType` is no longer strictly accurate, now that `NewType` is a class, rather than a function
* bpo-43137: webbrowser: Replace gvfs-open and gnome-open with "gio open" ↵Simon McVittie2021-11-252-7/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (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.
* bpo-40280: Add wasm cross build targets (GH-29771)Christian Heimes2021-11-253-4/+24
|
* bpo-33393: Update config.guess and config.sub (GH-29781)Christian Heimes2021-11-254-614/+695
|
* Add missing 'await writer.drain()' call to example (GH-29162)Sergey Kolesnikov2021-11-251-0/+1
| | | Automerge-Triggered-By: GH:asvetlov
* bpo-45568: Actually use @asynccontextmanager in usage example (GH-29151)Zbigniew Siciarz2021-11-251-0/+2
| | | Automerge-Triggered-By: GH:asvetlov
* bpo-41498: Fix build on platforms without sigset_t (GH-29770)Christian Heimes2021-11-255-18/+35
|
* bpo-45711: use exc_value instead of exc_type to determine if exc_info is ↵Irit Katriel2021-11-255-36/+93
| | | | valid. Add more assertions. (GH-29627)
* bpo-45727: Only trigger the 'did you forgot a comma' error suggestion if ↵Pablo Galindo Salgado2021-11-248-8/+15
| | | | inside parentheses (GH-29757)
* bpo-45893: Add missing extern C to initconfig.h (GH-29761)Christian Heimes2021-11-242-0/+10
| | | Co-authored-by: Steve Dower <steve.dower@python.org>
* bpo-45693: Document `port` parameter to `loop.create_server` (GH-29760)Jim Crist-Harif2021-11-241-0/+5
| | | | | | | | 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
* Fix typo in freeze_modules (#29744)Kumar Aditya2021-11-241-1/+1
|
* bpo-45020: Fix strict-prototypes warning (GH-29755)Christian Heimes2021-11-242-2/+2
|
* bpo-45822: Minor cleanups to the test_Py_CompileString test (GH-29750)Pablo Galindo Salgado2021-11-242-9/+9
|
* bpo-45881: Use CC from env first for cross building (GH-29752)Christian Heimes2021-11-242-10/+11
|
* bpo-45847: Fix _crypt detection on Ubuntu (GH-29743)Christian Heimes2021-11-242-2/+2
|
* bpo-45847: Port _uuid to PY_STDLIB_MOD (GH-29741)Christian Heimes2021-11-246-74/+391
|
* bpo-45514: Deprecate importlib resources legacy functions. (GH-29036)Jason R. Coombs2021-11-2410-84/+204
| | | | | | | | | | | * bpo-45514: Apply changes from importlib_resources@a3ef4128c6 * Mark legacy functions as deprecated in the docs and link to the migration docs in importlib_resources docs. * Apply changes from importlib_resources@329ae9d5f2c. * Indicate importlib.resources as a module. Co-authored-by: Filipe Laíns <lains@riseup.net>
* bpo-45847: Port _posixshmem to PY_STDLIB_MOD (GH-29738)Erlend Egeberg Aasland2021-11-245-70/+98
|
* bpo-45886: Allow overriding freeze command for cross compiling (GH-29735)Christian Heimes2021-11-243-43/+48
|
* bpo-45616: Let py.exe distinguish between v3.1 and v3.10 (GH-29731)Zachary Ware2021-11-242-1/+14
|
* bpo-45847: Port _gdbm to PY_STDLIB_MOD (GH-29720)Christian Heimes2021-11-235-52/+136
|
* bpo-45847: Port _ssl and _hashlib to PY_STDLIB_MOD (GH-29727)Christian Heimes2021-11-234-157/+348
|
* bpo-45847: Port _crypt to PY_STDLIB_MOD (GH-29725)Christian Heimes2021-11-234-63/+268
|
* bpo-45873: Restore Python 3.6 compatibility (GH-29730)Christian Heimes2021-11-233-3/+28
| | | Co-authored-by: Guido van Rossum <gvanrossum@gmail.com>
* bpo-39026: Fix Python.h when building with Xcode (GH-29488)Victor Stinner2021-11-233-3/+3
| | | | Fix Python.h to build C extensions with Xcode: remove a relative include from Include/cpython/pystate.h.
* bpo-45873: Get rid of bootstrap_python (#29717)Guido van Rossum2021-11-238-431/+259
| | | | | | | | | | | | | Instead we use $(PYTHON_FOR_REGEN) .../deepfreeze.py with the frozen .h file as input, as we did for Windows in bpo-45850. We also get rid of the code that generates the .h files when make regen-frozen is run (i.e., .../make_frozen.py), and the MANIFEST file. Restore Python 3.8 and 3.9 as Windows host Python again Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
* bpo-45703: Invalidate _NamespacePath cache on importlib.invalidate_ca… ↵Miro Hrončok2021-11-234-1/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (GH-29384) Consider the following directory structure: . └── PATH1 └── namespace └── sub1 └── __init__.py And both PATH1 and PATH2 in sys path: $ PYTHONPATH=PATH1:PATH2 python3.11 >>> import namespace >>> import namespace.sub1 >>> namespace.__path__ _NamespacePath(['.../PATH1/namespace']) >>> ... While this interpreter still runs, PATH2/namespace/sub2 is created: . ├── PATH1 │ └── namespace │ └── sub1 │ └── __init__.py └── PATH2 └── namespace └── sub2 └── __init__.py The newly created module cannot be imported: >>> ... >>> namespace.__path__ _NamespacePath(['.../PATH1/namespace']) >>> import namespace.sub2 Traceback (most recent call last): File "<stdin>", line 1, in <module> ModuleNotFoundError: No module named 'namespace.sub2' Calling importlib.invalidate_caches() now newly allows to import it: >>> import importlib >>> importlib.invalidate_caches() >>> namespace.__path__ _NamespacePath(['.../PATH1/namespace']) >>> import namespace.sub2 >>> namespace.__path__ _NamespacePath(['.../PATH1/namespace', '.../PATH2/namespace']) This was not previously possible.
* bpo-45783: Preserve file moves and deletions in the tests for the freeze ↵Eric Snow2021-11-233-35/+17
| | | | | | tool. (GH-29527) Use shutil.copytree rather than Git, which might be missing (or configured differently) when testing Python built from a source release.
* bpo-45878: convert `try/except` to `self.assertRaises` in ↵Nikita Sobolev2021-11-232-14/+6
| | | | `Lib/ctypes/test/test_functions.py` (GH-29721)
* Clarify that discutils.(plat)include is for CPython's headers (GH-29578)Petr Viktorin2021-11-231-2/+4
| | | | | | | Change the docs to note that "include" and "platinclude" are for CPython's headers, and not necessarily for headers of third-party libraries. See discussion in: https://discuss.python.org/t/clarification-on-a-wheels-header-data/9305/19
* bpo-44525: Copy free variables in bytecode to allow calls to inner functions ↵Mark Shannon2021-11-2325-157/+269
| | | | | | | | | | | to be specialized (GH-29595) * Make internal APIs that take PyFrameConstructor take a PyFunctionObject instead. * Add reference to function to frame, borrow references to builtins and globals. * Add COPY_FREE_VARS instruction to allow specialization of calls to inner functions.
* bpo-45847: Port _socket to PY_STDLIB_MOD (GH-29713)Erlend Egeberg Aasland2021-11-234-4/+19
|
* bpo-45847: Fix xxlimited and xxlimited_35 build conditions (GH-29715)Erlend Egeberg Aasland2021-11-232-4/+4
|
* bpo-45561: Run smelly.py tool from $(srcdir) (GH-29138)Neil Schemenauer2021-11-233-4/+8
|
* bpo-42238: [doc] Announce the future removal of make suspicous. (GH-29652)Julien Palard2021-11-222-0/+6
| | | | | * bpo-42238: [doc] Announce the future removal of make suspicous. * Add a news entry.
* bpo-45847: Port xxlimited and xxlimited_35 to PY_STDLIB_MOD (GH-29707)Erlend Egeberg Aasland2021-11-224-6/+99
|
* bpo-45850: Implement deep-freeze on Windows (#29648)Guido van Rossum2021-11-229-24/+500
| | | | | | Implement changes to build with deep-frozen modules on Windows. Note that we now require Python 3.10 as the "bootstrap" or "host" Python. This causes a modest startup speed (around 7%) on Windows.
* bpo-45871: Refactor except matcher validation into a separate function so ↵Irit Katriel2021-11-222-23/+48
| | | | that it can be reused. Add missing unit test. (GH-29711)
* bpo-45847: port _struct to PY_STDLIB_MOD (GH-29706)Christian Heimes2021-11-224-2/+23
|
* bpo-45859: Mark test_field_descriptor in test_collections as CPython-only ↵Carl Friedrich Bolz-Tereick2021-11-221-0/+1
| | | | (GH-29691)
* bpo-45847: Port audioop, _csv, and _posixsubprocess to PY_STDLIB_MOD_SIMPLE ↵Erlend Egeberg Aasland2021-11-224-4/+56
| | | | | (GH-29705) Automerge-Triggered-By: GH:tiran
* bpo-45847: Port nis module to PY_STDLIB_MOD (GH-29699)Christian Heimes2021-11-225-44/+350
|
* bpo-45813: Make sure that frame->generator is NULLed when generator is ↵Mark Shannon2021-11-224-0/+12
| | | | deallocated. (GH-29700)
* bpo-45847: Port compression libs to PY_STDLIB_MOD (GH-29702)Christian Heimes2021-11-225-70/+794
|
* bpo-45847: Port mmap, select, and _xxsubinterpreters to Py_STDLIB_MOD (GH-29703)Erlend Egeberg Aasland2021-11-224-4/+83
|
* bpo-44649: Fix dataclasses(slots=True) with a field with a default, but ↵Eric V. Smith2021-11-223-6/+37
| | | | | init=False (GH-29692) Special handling is needed, because for non-slots dataclasses the instance attributes are not set: reading from a field just references the class's attribute of the same name, which contains the default value. But this doesn't work for classes using __slots__: they don't read the class's attribute. So in that case (and that case only), initialize the instance attribute. Handle this for both normal defaults, and for fields using default_factory.
* bpo-45847: Port fcntl to Py_STDLIB_MOD (GH-29696)Erlend Egeberg Aasland2021-11-225-28/+60
| | | Co-authored-by: Christian Heimes <christian@python.org>
* bpo-45847: Various PY_STDLIB_MOD cleanups (GH-29697)Christian Heimes2021-11-223-218/+61
|