Commit Graph

49445 Commits

Author SHA1 Message Date
Nikita Sobolev c69cfcdb11
closes gh-99508: fix `TypeError` in `Lib/importlib/_bootstrap_external.py` (GH-99635) 2022-11-23 16:47:31 -06:00
Charles Machalow 1b2de89bce
gh-99547: Add isjunction methods for checking if a path is a junction (GH-99548) 2022-11-22 17:19:34 +00:00
Serhiy Storchaka c2102136be
gh-99645: Fix a bug in handling class cleanups in unittest.TestCase (GH-99646)
Now addClassCleanup() uses separate lists for different TestCase subclasses,
and doClassCleanups() only cleans up the particular class.
2022-11-22 17:49:37 +02:00
Dong Uk, Kang 995f6170c7
gh-88863: Clear ref cycles to resolve leak when asyncio.open_connection raises (#95739)
Break reference cycles to resolve memory leak, by
removing local exception and future instances from the frame
2022-11-22 07:06:20 -08:00
mpage 3db0a21f73
gh-91053: Add an optional callback that is invoked whenever a function is modified (#98175) 2022-11-22 13:06:44 +01:00
Batuhan Taskaya 1acdfec359
gh-99341: Cover type ignore nodes when incrementing line numbers (GH-99422) 2022-11-22 02:41:14 -08:00
Petr Viktorin 4d82f628c4
gh-47146: Soft-deprecate structmember.h, expose its contents via Python.h (GH-99014)
The ``structmember.h`` header is deprecated, though it continues to be available
and there are no plans to remove it. There are no deprecation warnings. Old code
can stay unchanged (unless the extra include and non-namespaced macros bother
you greatly). Specifically, no uses in CPython are updated -- that would just be
unnecessary churn.
The ``structmember.h`` header is deprecated, though it continues to be
available and there are no plans to remove it.

Its contents are now available just by including ``Python.h``,
with a ``Py`` prefix added if it was missing:

- `PyMemberDef`, `PyMember_GetOne` and`PyMember_SetOne`
- Type macros like `Py_T_INT`, `Py_T_DOUBLE`, etc.
  (previously ``T_INT``, ``T_DOUBLE``, etc.)
- The flags `Py_READONLY` (previously ``READONLY``) and
  `Py_AUDIT_READ` (previously all uppercase)

Several items are not exposed from ``Python.h``:

- `T_OBJECT` (use `Py_T_OBJECT_EX`)
- `T_NONE` (previously undocumented, and pretty quirky)
- The macro ``WRITE_RESTRICTED`` which does nothing.
- The macros ``RESTRICTED`` and ``READ_RESTRICTED``, equivalents of
  `Py_AUDIT_READ`.
- In some configurations, ``<stddef.h>`` is not included from ``Python.h``.
  It should be included manually when using ``offsetof()``.

The deprecated header continues to provide its original
contents under the original names.
Your old code can stay unchanged, unless the extra include and non-namespaced
macros bother you greatly.

There is discussion on the issue to rename `T_PYSSIZET` to `PY_T_SSIZE` or
similar. I chose not to do that -- users will probably copy/paste that with any
spelling, and not renaming it makes migration docs simpler.


Co-Authored-By: Alexander Belopolsky <abalkin@users.noreply.github.com>
Co-Authored-By: Matthias Braun <MatzeB@users.noreply.github.com>
2022-11-22 08:25:43 +01:00
Łukasz Langa 2781ec9b0e
gh-99659: Use correct exceptions in sqlite3 bigmem tests (#99660)
The tests in question were added in 0eec6276fd by Serhiy. Apparently,
sqlite3 changed exceptions raised in those cases in the mean time but
the tests never ran because they require a high `-M` setting in the
test runner.
2022-11-21 21:44:17 +01:00
colorfulappl c450c8c9ed
gh-96002: Add functional test for Argument Clinic (#96178)
Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
2022-11-21 15:08:45 +01:00
Serhiy Storchaka 653e563d80
Add more details in test_unittest (GH-99626) 2022-11-21 13:57:30 +02:00
Victor Stinner cb2ef8b2ac
gh-99578: Fix refleak in _imp.create_builtin() (#99642)
Fix a reference bug in _imp.create_builtin() after the creation of
the first sub-interpreter for modules "builtins" and "sys".
2022-11-21 12:14:54 +01:00
Lysandros Nikolaou 6d8da238cc
gh-90994: Improve error messages upon call arguments syntax errors (GH-96893) 2022-11-21 00:15:05 +01:00
Pablo Galindo Salgado e13d1d9dda
gh-99581: Fix a buffer overflow in the tokenizer when copying lines that fill the available buffer (#99605) 2022-11-20 20:20:03 +00:00
Gregory P. Smith abf5b6ff43
gh-61460: Add a comment describing the multiprocessing.connection protocol (gh-99623)
Describe the multiprocessing connection protocol.

It isn't a good protocol, but it is what it is.  This way we can more
easily reason about making changes to it in a backwards compatible way.
2022-11-20 10:20:04 -08:00
Lysandros Nikolaou 9c4232ae89
gh-99211: Point to except/except* on syntax errors when mixing them (GH-99215)
Automerge-Triggered-By: GH:lysnikolaou
2022-11-20 09:11:02 -08:00
Filipe Laíns b0e1f9c241
gh-99201: fix IndexError when initializing sysconfig config variables 2022-11-19 20:47:09 +00:00
Irit Katriel c8c6113398
gh-99553: fix bug where an ExceptionGroup subclass can wrap a BaseException (GH-99572) 2022-11-18 15:44:43 +00:00
Steve Dower a220c6d1ee
gh-99442: Fix handling in py.exe launcher when argv[0] does not include a file extension (GH-99542) 2022-11-18 14:14:56 +00:00
Brandt Bucher 8555dee5ae
GH-98686: Get rid of BINARY_OP_GENERIC and COMPARE_OP_GENERIC (GH-99399) 2022-11-17 11:36:57 -08:00
Steve Dower 5fdd49dc65
gh-99377: Revert audit events for thread state creation and free, because the GIL is not properly held at these times (GH-99543) 2022-11-17 00:24:16 +00:00
Steve Dower 7c57857340
gh-99370: Prefer LIBDIR from sysconfig when locating libpython for test (GH-99523) 2022-11-16 21:41:13 +00:00
Erlend E. Aasland 51d10354f4
gh-93649: Split watcher API tests from _testcapimodule.c (#99532) 2022-11-16 20:13:32 +01:00
Steve Dower 19c1462e8d
gh-99377: Add audit events for thread creation and clear (GH-99378) 2022-11-16 17:15:52 +00:00
Nikita Sobolev 5cfb7d19f5
gh-99518: Fix escape symbol in `test_enum` (#99519) 2022-11-16 15:06:37 +01:00
Ethan Furman 65dab1506e
gh-92647: [Enum] use final status to determine lookup or create (GH-99500)
* use final status to determine lookup or create

* 📜🤖 Added by blurb_it.

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
2022-11-15 08:49:22 -08:00
Thomas Wouters 73943cbc4c Merge the 3.12.0a2 release into main. 2022-11-15 13:38:09 +01:00
Kai Zhang 1df0752b4d
gh-99370: fix test_zippath_from_non_installed_posix (GH-99483)
When build with shared enabled, we need to set `LD_LIBRARY_PATH`
for the non-installed python environment in
test_zippath_from_non_installed_posix so that the python binary
and find and link the libpython.so.
2022-11-15 01:01:01 +00:00
Steve Dower 4e4b13e8f6
gh-87604: Avoid publishing list of active per-interpreter audit hooks via the gc module (GH-99373) 2022-11-14 21:39:18 +00:00
Kumar Aditya 619cadcda6
GH-98219: reduce sleep time in `asyncio` subprocess test (#99464) 2022-11-14 11:53:11 -08:00
Kumar Aditya f63002755d
GH-99388: add `loop_factory` parameter to `asyncio.run` (#99462) 2022-11-14 10:18:51 -08:00
Kai Zhang e3d4fed074
gh-99370: Calculate zip path from prefix when in a venv (GH-99371)
Before python3.11, when in a venv the zip path is calculated
from prefix on POSIX platforms. In python3.11 the behavior is
accidentally changed to calculating from default prefix. This
change will break venv created from a non-installed python
with a stdlib zip file. This commit restores the behavior back
to before python3.11.
2022-11-14 15:05:14 +00:00
Irit Katriel a3ac9232f8
gh-87092: expose the compiler's codegen to python for unit tests (GH-99111) 2022-11-14 13:56:40 +00:00
Serhiy Storchaka 06d4e02c3b
gh-78453: Move Unicode C API tests from test_unicode to test_capi.test_unicode (GH-99431) 2022-11-14 15:32:02 +02:00
Thomas Wouters 3b9d793efc Python 3.12.0a2 2022-11-14 12:18:11 +01:00
Ethan Furman db115682bd
[Enum] update version TODO comment (GH-99458) 2022-11-13 20:52:30 -08:00
Christoph Anton Mitterer 367f552129
gh-96192: fix os.ismount() to use a path that is str or bytes (#96194)
Signed-off-by: Christoph Anton Mitterer <mail@christoph.anton.mitterer.name>
Co-authored-by: Eryk Sun <eryksun@gmail.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2022-11-13 20:12:32 -08:00
Nikita Sobolev 343eb0f94b
gh-99275: Fix `SystemError` in `ctypes` during `__initsubclass__` (#99283) 2022-11-13 11:22:45 -08:00
Nikita Sobolev d329f859b9
gh-99430: Remove duplicated tests for old-styled classes (#99432)
python 1 & 2 were a loong time ago.
2022-11-13 10:30:00 -08:00
Ben Kallus 439b9cfaf4
gh-99418: Make urllib.parse.urlparse enforce that a scheme must begin with an alphabetical ASCII character. (#99421)
Prevent urllib.parse.urlparse from accepting schemes that don't begin with an alphabetical ASCII character.

RFC 3986 defines a scheme like this: `scheme = ALPHA *( ALPHA / DIGIT / "+" / "-" / "." )`
RFC 2234 defines an ALPHA like this: `ALPHA = %x41-5A / %x61-7A`

The WHATWG URL spec defines a scheme like this:
`"A URL-scheme string must be one ASCII alpha, followed by zero or more of ASCII alphanumeric, U+002B (+), U+002D (-), and U+002E (.)."`
2022-11-13 10:25:55 -08:00
Victor Stinner 6788303f5c
gh-91248: Optimize PyFrame_GetVar() (#99252)
PyFrame_GetVar() no longer creates a temporary dictionary to get a
variable.
2022-11-13 15:37:03 +01:00
Batuhan Taskaya 57be545959
gh-99103: Normalize specialized traceback anchors against the current line (GH-99145)
Automerge-Triggered-By: GH:isidentical
2022-11-12 15:37:25 -08:00
Erlend E. Aasland c95f554a40
gh-83638: Add sqlite3.Connection.autocommit for PEP 249 compliant behaviour (#93823)
Introduce the autocommit attribute to Connection and the autocommit
parameter to connect() for PEP 249-compliant transaction handling.

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
Co-authored-by: Géry Ogam <gery.ogam@gmail.com>
2022-11-12 23:44:41 +01:00
Xiao Chen 99972dc745
gh-99357: Close the event loop when it is no longer used in test_uncancel_structured_blocks (#99414) 2022-11-12 12:16:44 -08:00
Irit Katriel fb844e1931
gh-98762: Fix locations of match sub-patterns (GH-98775) 2022-11-12 18:42:17 +00:00
Kumar Aditya aa874326d8
GH-94597: add deprecation warnings for subclassing `AbstractChildWatcher` (#99386) 2022-11-11 23:17:53 -08:00
Hai Shi e02cc6d42a
gh-80448: argparse: Fix IndexError on store_true action (#15656)
Co-authored-by: Rémi Lapeyre <remi.lapeyre@henki.fr>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
2022-11-11 17:51:38 -08:00
NewUserHa 55c96e8053
gh-99305: Speed up secrets.token_hex() ~2x (#99306)
simple code modernization.

Co-authored-by: Pieter Eendebak <pieter.eendebak@gmail.com>
2022-11-11 14:45:24 -08:00
Irit Katriel 3dd6ee2c00
gh-99254: remove all unused consts from code objects (GH-99255) 2022-11-11 10:53:43 +00:00
Nikita Sobolev faf7dfa656
gh-99325: Remove unused `NameError` handling (#99326) 2022-11-11 09:56:57 +00:00
Nikita Sobolev 67b4d2772c
gh-98086: Now ``patch.dict`` can decorate async functions (#98095) 2022-11-11 08:04:30 +00:00