Commit Graph

118619 Commits

Author SHA1 Message Date
Dong-hee Na 28cab71f95
gh-104504: Run mypy on cases_generator in CI (and blacken the code) (gh-108090)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-08-18 22:42:45 +09:00
Erlend E. Aasland fd19509220
gh-108083: Don't ignore exceptions in sqlite3.Connection.__init__() and .close() (#108084)
- Add explanatory comments
- Add return value to connection_close() for propagating errors
- Always check the return value of connection_exec_stmt()
- Assert pre/post state in remove_callbacks()
- Don't log unraisable exceptions in case of interpreter shutdown
- Make sure we're not initialized if reinit fails
- Try to close the database even if ROLLBACK fails

Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-08-18 11:39:12 +00:00
Victor Stinner 3ff5ef2ad3
gh-108014: Add Py_IsFinalizing() function (#108032)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-08-18 12:34:41 +02:00
Erlend E. Aasland cc58ec9724
Docs: emphasise warning and add accurate markups for sys.unraisablehook (#108105) 2023-08-18 12:16:22 +02:00
Erlend E. Aasland 02079b010c
gh-107801: Improve the docs of the SEEK_* constants (#108099) 2023-08-17 20:41:35 +00:00
Erlend E. Aasland 5c76899dad
Docs: Fix Sphinx warnings in io.rst (#107903)
- Mark up parameter and argument names properly
- If possible, link to docs for methods like `seek`, `tell`, `write`, `read`, etc.

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2023-08-17 19:19:01 +00:00
Pablo Galindo Salgado 75b3db8445
gh-107944: Improve error message for function calls with bad keyword arguments (#107969) 2023-08-17 19:39:42 +01:00
Guido van Rossum 61c7249759
gh-106581: Project through calls (#108067)
This finishes the work begun in gh-107760. When, while projecting a superblock, we encounter a call to a short, simple function, the superblock will now enter the function using `_PUSH_FRAME`, continue through it, and leave it using `_POP_FRAME`, and then continue through the original code. Multiple frame pushes and pops are even possible. It is also possible to stop appending to the superblock in the middle of a called function, when running out of space or encountering an unsupported bytecode.
2023-08-17 11:29:58 -07:00
Erlend E. Aasland 292a22bdc2
gh-104683: Argument Clinic: Remove unreachable code from _module_and_class() (#108092)
'not hasattr(parent, "classes")' is always false, since 'parent' is an
instance of either the Module, Class, or Clinic classes, and all of
them has a "classes" attribute.
2023-08-17 18:16:08 +00:00
Nikita Sobolev 80f30cf51b
gh-102029: Deprecate passing arguments to `_PyRLock` in `threading` (#102071) 2023-08-17 09:19:07 -07:00
Irit Katriel 0b243c2f66
gh-105481: opcode.h is no longer generated during the build (#108080) 2023-08-17 17:07:58 +01:00
Adam Turner 4cb08188e8
Add workflow for automatic issue headers (#108054)
We don't get the "Bug report" and "Feature or enhancement" titles anymore, with the new issue forms. This brings them back!
2023-08-17 16:37:07 +01:00
Erlend E. Aasland 8a19f225b9
gh-107801: Document SEEK_HOLE and SEEK_DATA (#107936)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Antoine Pitrou <antoine@python.org>
2023-08-17 16:14:01 +02:00
Irit Katriel 2da67a5789
gh-105481: fix out of date comment (#108079) 2023-08-17 10:25:28 +00:00
Mark Shannon 006e44f950
GH-108035: Remove the `_PyCFrame` struct as it is no longer needed for performance. (GH-108036) 2023-08-17 11:16:03 +01:00
Adam Turner 33e6e3fec0
GH-107987: Remove the Distributing Python Modules guide (#108016) 2023-08-17 13:01:14 +03:00
Serhiy Storchaka f51f0466c0
gh-107298: Fix some references in the C API documentation (GH-108072) 2023-08-17 11:16:00 +03:00
Erlend E. Aasland 1344cfac43
gh-105539: Explict resource management for connection objects in sqlite3 tests (#108017)
- Use memory_database() helper
- Move test utility functions to util.py
- Add convenience memory database mixin
- Add check() helper for closed connection tests
2023-08-17 08:45:48 +02:00
Serhiy Storchaka c9d83f93d8
gh-107298: Add standard exceptions and warnings in the nitpick_ignore list (GH-108029) 2023-08-17 09:44:05 +03:00
Guido van Rossum dc8fdf5fd5
gh-106581: Split `CALL_PY_EXACT_ARGS` into uops (#107760)
* Split `CALL_PY_EXACT_ARGS` into uops

This is only the first step for doing `CALL` in Tier 2.
The next step involves tracing into the called code object and back.
After that we'll have to do the remaining `CALL` specialization.
Finally we'll have to deal with `KW_NAMES`.

Note: this moves setting `frame->return_offset` directly in front of
`DISPATCH_INLINED()`, to make it easier to move it into `_PUSH_FRAME`.
2023-08-16 16:26:43 -07:00
Irit Katriel 665a4391e1
gh-105481: generate op IDs from bytecode.c instead of hard coding them in opcode.py (#107971) 2023-08-16 22:25:18 +00:00
Adam Turner e88eb3775e
GH-92584: Remove references to Distutils in configure.rst (#108043)
Remove references to Distutils in configure.rst
2023-08-16 23:13:05 +02:00
Adam Turner fbb7cbc0e9
GH-92584: Remove Installing Python Modules (Distutils version) (#108020) 2023-08-16 21:06:56 +00:00
Adam Turner 636ca313b2
GH-92584: Remove references to Distutils in ``PYTHONUSERBASE`` (#108040)
Remove references to Distutils in ``PYTHONUSERBASE``
2023-08-16 22:43:30 +02:00
Adam Turner 902864256c
GH-92584: Redirect macOS package installation to the PPUG (#108044) 2023-08-16 20:42:23 +00:00
Serhiy Storchaka 882cb79afa
gh-56166: Deprecate passing confusing positional arguments in re functions (#107778)
Deprecate passing optional arguments maxsplit, count and flags in
module-level functions re.split(), re.sub() and re.subn() as positional.
They should only be passed by keyword.
2023-08-16 13:35:35 -07:00
Victor Stinner fb8fe377c4
gh-107211: Fix select extension build on Solaris (#108012)
Export the internal _Py_open() and _Py_write() functions for Solaris:
the select shared extension uses them.
2023-08-16 22:26:22 +02:00
Adam Turner 57fcf96e4f
GH-92584: Remove reference to Distutils in ``cx_Freeze``'s description (#108047)
Remove reference to Distutils in ``cx_Freeze``'s description
2023-08-16 22:23:12 +02:00
Nikita Sobolev 199438b7cc
gh-105522: [Enum] Correctly handle possible exceptions during testing (GH-105523) 2023-08-16 12:17:28 -07:00
Carl Meyer fce93c80ae
gh-91051: fix type watcher test to be robust to existing watcher (#107989) 2023-08-16 13:13:32 -06:00
Alex Waygood 8891a8821d
Improve the feature-proposal issue form (#108033)
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2023-08-16 19:38:58 +01:00
Hugo van Kemenade 0d7f5d3ba3
Remove Sphinx problem matcher to avoid annotating unchanged files (#108005) 2023-08-16 12:18:56 -06:00
Victor Stinner c2941cba7a
gh-107298: Fix C API Buffer documentation (#108011) 2023-08-16 18:24:46 +02:00
Adam Turner f2a9dfdee9
GH-92584: Drop reference to Distutils in ``site.USER_BASE`` (#108031)
Drop reference to Distutils in ``site.USER_BASE``
2023-08-16 18:10:44 +02:00
Erlend E. Aasland 42429d3b9a
gh-104683: Argument Clinic: Extract parse function name helper (#107964)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-08-16 13:47:15 +00:00
Nikita Sobolev b61f5995ae
gh-107909: Test explicit `object` base in PEP695 generic classes (#108001) 2023-08-16 06:30:03 -07:00
Nikita Sobolev a8d440b383
gh-108000: Test that `lambda` also has `__type_params__` (#108002) 2023-08-16 06:22:18 -07:00
Victor Stinner e35c722d22
gh-106659: Fix test_embed.test_forced_io_encoding() on Windows (#108010)
Use config.legacy_windows_stdio=1 to avoid _io._WindowsConsoleIO.
2023-08-16 11:56:56 +00:00
Erlend E. Aasland 57a20b0960
gh-106368: Argument Clinic: Test that keyword params are disallowed in groups (#107985) 2023-08-16 12:39:56 +02:00
Nikita Sobolev bdd8ddfda1
gh-105724: Add location information to `assert` errors (GH-105935) 2023-08-16 11:35:38 +01:00
Nikita Sobolev fd9d70a94d
gh-106300: Improve errors testing in test_unittest.test_runner (GH-106737)
Use a custom exception to prevent unintentional silence of actual errors.
2023-08-16 12:20:42 +03:00
brandonardenwalli f6099871fa
gh-107955 Remove old comment about increasing the reference count in usage of Py_None (#107993) 2023-08-16 09:14:14 +00:00
SKO abd9cc52d9
gh-100061: Proper fix of the bug in the matching of possessive quantifiers (GH-102612)
Restore the global Input Stream pointer after trying to match a sub-pattern.

Co-authored-by: Ma Lin <animalize@users.noreply.github.com>
2023-08-16 10:43:45 +03:00
6t8k a86df298df
gh-99203: shutil.make_archive(): restore select CPython <= 3.10.5 behavior (GH-99802)
Restore following CPython <= 3.10.5 behavior of shutil.make_archive()
that went away as part of gh-93160:

Do not create an empty archive if root_dir is not a directory, and, in
that case, raise FileNotFoundError or NotADirectoryError regardless
of format choice. Beyond the brought-back behavior, the function may
now also raise these exceptions in dry_run mode.
2023-08-16 10:00:03 +03:00
Yuxin Wu a794ebeb02
More actionable error message when spawn is incorrectly used. (#102203)
Co-authored-by: Yuxin Wu <ppwwyyxx@users.noreply.github.com>
Co-authored-by: Oleg Iarygin <oleg@arhadthedev.net>
2023-08-15 18:03:45 -07:00
Erlend E. Aasland bb456a08a3
gh-106368: Argument Clinic: Add tests for cloned functions with custom C base names (#107977) 2023-08-15 14:45:53 -06:00
Martin DeMello 99b6ce56f8
Note that lnotab_notes.txt is only valid before 3.11 (#107961) 2023-08-15 20:27:35 +00:00
Ken Jin e28b0dc86d
gh-107557: Setup abstract interpretation (#107847)
Co-authored-by: Guido van Rossum <gvanrossum@users.noreply.github.com>
Co-authored-by: Jules <57632293+juliapoo@users.noreply.github.com>
2023-08-15 18:04:17 +00:00
Steve Dower 34e1917912
gh-106242: Minor fixup to avoid compiler warnings (GH-107983) 2023-08-15 17:02:32 +00:00
Irit Katriel 971a4c2751
gh-103082: remove assumption that INSTRUMENTED_LINE is the last instrumented opcode (#107978) 2023-08-15 16:40:05 +01:00