Commit Graph

120647 Commits

Author SHA1 Message Date
Serhiy Storchaka 652fbf88c4
gh-82626: Emit a warning when bool is used as a file descriptor (GH-111275) 2024-02-05 22:51:11 +02:00
Erlend E. Aasland 09096a1647
gh-115015: Argument Clinic: fix generated code for METH_METHOD methods without params (#115016) 2024-02-05 21:49:17 +01:00
Serhiy Storchaka 4aa4f0906d
gh-109475: Fix support of explicit option value "--" in argparse (GH-114814)
For example "--option=--".
2024-02-05 22:42:43 +02:00
HarryLHW 750489cc77
gh-114967: Fix "Built-in Exceptions" documentation ambiguous wording (#114968)
Change the somewhat vague "listed below" to "listed in this chapter" in Doc/library/exceptions.rst.
The exceptions are listed in multiple sections after two intermediate sections.
---------
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2024-02-05 15:22:57 -05:00
Dino Viehland bcccf1fb63
gh-112075: Add gc shared bits (#114931)
Add GC shared flags for objects to the GC bit states in free-threaded builds
2024-02-05 10:35:59 -08:00
Mark Shannon 36518e69d7
GH-108362: Incremental GC implementation (GH-108038) 2024-02-05 18:28:51 +00:00
Serhiy Storchaka b4ba0f73d6
gh-43457: Tkinter: fix design flaws in wm_attributes() (GH-111404)
* When called with a single argument to get a value, it allow to omit
  the minus prefix.
* It can be called with keyword arguments to set attributes.
* w.wm_attributes(return_python_dict=True) returns a dict instead of 
  a tuple (it will be the default in future).
* Setting wantobjects to 0 no longer affects the result.
2024-02-05 18:24:54 +02:00
Mark Shannon 992446dd5b
GH-113462: Limit the number of versions that a single class can use. (GH-114900) 2024-02-05 16:20:54 +00:00
Nikita Sobolev 87cd20a567
gh-115026: Argument Clinic: handle PyBuffer_FillInfo errors in generated code (#115027) 2024-02-05 11:45:09 +01:00
Kirill Podoprigora f71bdd3408
gh-115020: Remove a debugging print in test_frame (GH-115021) 2024-02-05 12:20:34 +02:00
Terry Jan Reedy 39ec7fbba8
Remove bogus syntax error marker in csv doc (#115017) 2024-02-05 04:11:31 +00:00
Terry Jan Reedy e207cc181f
gh-114628: Display csv.Error without context (#115005)
When cvs.Error is raised when TypeError is caught,
the TypeError display and 'During handling' note is just noise
with duplicate information.  Suppress with 'from None'.
2024-02-04 20:57:54 -05:00
Russell Keith-Magee 391659b3da
gh-114099: Add test exclusions to support running the test suite on iOS (#114889)
Add test annotations required to run the test suite on iOS (PEP 730).

The majority of the change involve annotating tests that use subprocess,
but are skipped on Emscripten/WASI for other reasons, and including
iOS/tvOS/watchOS under the same umbrella as macOS/darwin checks.

`is_apple` and `is_apple_mobile` test helpers have been added to
identify *any* Apple platform, and "any Apple platform except macOS",
respectively.
2024-02-05 01:04:57 +01:00
Serhiy Storchaka 15f6f048a6
gh-114392: Improve test_capi.test_structmembers (GH-114393)
Test all integer member types with extreme values and values outside of
the valid range. Test support of integer-like objects. Test warnings for
wrapped out values.
2024-02-04 22:19:06 +02:00
Nikita Sobolev 929d44e15a
gh-114685: PyBuffer_FillInfo() now raises on PyBUF_{READ,WRITE} (GH-114802) 2024-02-04 19:16:43 +00:00
Dai Wentao da8f9fb2ea
gh-113803: Fix inaccurate documentation for shutil.move when dst is an existing directory (#113837)
* fix the usage of dst and destination in shutil.move doc
* update shutil.move doc
2024-02-04 13:42:58 -05:00
Serhiy Storchaka d466052ad4
gh-114388: Fix an error in GH-114391 (GH-115000) 2024-02-04 17:06:22 +00:00
Serhiy Storchaka 7e42fddf60
gh-113951: Tkinter: "tag_unbind(tag, sequence, funcid)" now only unbinds "funcid" (GH-113955)
Previously, "tag_unbind(tag, sequence, funcid)" methods of Text and
Canvas widgets destroyed the current binding for "sequence", leaving
"sequence" unbound, and deleted the "funcid" command.

Now they remove only "funcid" from the binding for "sequence", keeping
other commands, and delete the "funcid" command.
They leave "sequence" unbound only if "funcid" was the last bound command.
2024-02-04 17:49:42 +02:00
Serhiy Storchaka 3ddc515255
gh-114388: Fix warnings when assign an unsigned integer member (GH-114391)
* Fix a RuntimeWarning emitted when assign an integer-like value that
  is not an instance of int to an attribute that corresponds to a C
  struct member of type T_UINT and T_ULONG.
* Fix a double RuntimeWarning emitted when assign a negative integer value
  to an attribute that corresponds to a C struct member of type T_UINT.
2024-02-04 17:32:25 +02:00
Serhiy Storchaka 0ea366240b
gh-113280: Always close socket if SSLSocket creation failed (GH-114659)
Co-authored-by: Thomas Grainger <tagrain@gmail.com>
2024-02-04 15:28:07 +00:00
Serhiy Storchaka ecabff98c4
gh-113267: Revert "gh-106584: Fix exit code for unittest in Python 3.12 (#106588)" (GH-114470)
This reverts commit 8fc071345b.
2024-02-04 17:27:42 +02:00
Serhiy Storchaka ca715e56a1
gh-69893: Add the close() method for xml.etree.ElementTree.iterparse() iterator (GH-114534) 2024-02-04 17:25:21 +02:00
Serhiy Storchaka fc06096911
gh-83383: Always mark the dbm.dumb database as unmodified after open() and sync() (GH-114560)
The directory file for a newly created database is now created
immediately after opening instead of deferring this until synchronizing
or closing.
2024-02-04 17:23:26 +02:00
Ethan Furman ff7588b729
gh-114071: [Enum] update docs and code for tuples/subclasses (GH-114871)
Update documentation with `__new__` and `__init__` entries.

Support use of `auto()` in tuple subclasses on member assignment lines.  Previously, auto() was only supported on the member definition line either solo or as part of a tuple:

    RED = auto()
    BLUE = auto(), 'azul'

However, since Python itself supports using tuple subclasses where tuples are expected, e.g.:

    from collections import namedtuple
    T = namedtuple('T', 'first second third')

    def test(one, two, three):
        print(one, two, three)

    test(*T(4, 5, 6))
    # 4 5 6

it made sense to also support tuple subclasses in enum definitions.
2024-02-04 07:22:55 -08:00
Skip Montanaro ec69e1d0dd
gh-101100: Fix dangling references in pickle.rst (#114972)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2024-02-04 14:24:24 +00:00
Hugo van Kemenade 848c86786b
gh-101100: Fix Sphinx warnings from PEP 3108 stdlib re-organisation (#114327)
* Fix Sphinx warnings from PEP 3108 stdblib re-organisation

* Apply suggestions from code review

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>

* Update Doc/whatsnew/2.2.rst

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>

* Apply suggestions from code review

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>

---------

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2024-02-04 09:45:35 +00:00
Skip Montanaro 80734a6872
Update README.md (#114974)
Trivial edit

Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
2024-02-04 00:16:30 +00:00
Zachary Ware 1032326fe4
gh-114883: Fix Makefile dependency tree for non-jit builds (GH-114884) 2024-02-03 23:16:03 +00:00
Nikita Sobolev 72d2d0f10d
gh-114803: Mention that `@dataclass` should not be applied on enums (GH-114891)
Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
2024-02-03 13:55:38 -08:00
Skip Montanaro ab76d37948
gh-101100: Fix Sphinx reference warnings in the glossary (#114729)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2024-02-03 18:45:49 +00:00
Stéphane Bidoul a4c298c149
gh-114965: Updated bundled pip to 24.0 (gh-114966)
Updated bundled pip to 24.0
2024-02-03 17:45:09 +00:00
Travis Howse 94ec2b9c9c
gh-114887 Reject only sockets of type SOCK_STREAM in create_datagram_endpoint() (#114893)
Also improve exception message.

Co-authored-by: Donghee Na <donghee.na92@gmail.com>
2024-02-03 17:14:02 +00:00
Kristján Valur Jónsson 6b53d5fe04
gh-112202: Ensure that condition.notify() succeeds even when racing with Task.cancel() (#112201)
Also did a general cleanup of asyncio locks.py comments and docstrings.
2024-02-03 08:19:37 -08:00
Serhiy Storchaka 96bce033c4
gh-114959: tarfile: do not ignore errors when extract a directory on top of a file (GH-114960)
Also, add tests common to tarfile and zipfile.
2024-02-03 16:18:46 +00:00
AN Long b4240fd68e
gh-114955: Add clear to MutableSequence's mixin methods in document (gh-114956) 2024-02-03 09:33:58 -06:00
Jason Zhang efc489021c
gh-111417: Remove unused code block in math.trunc() and round() (GH-111454)
_PyObject_LookupSpecial() now ensures that the type is ready.
2024-02-03 17:11:10 +02:00
Mariusz Felisiak 28bb2961ba
Update LOGGING example taken from Django docs. (#114903)
For example, Django no longer provides a custom NullHandler

6c66a41c3d

* Remove require_debug_true.
2024-02-03 09:37:21 +02:00
Skip Montanaro 00d7109075
Normalize heading underline in multiprocessing.rst (#114923)
This gets rid of the mildly confusing `>>>>>>>' underlines which look vaguely like `diff` punctuation.
2024-02-02 17:56:00 -08:00
Kirill Podoprigora f3cdd64de8
``Tools/cases_generator``: Fix typos and incorrect comments. (#114892) 2024-02-02 17:52:58 -08:00
Malcolm Smith f35c7c070c
gh-114875: Require getgrent for building the grp extension module (#114876)
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
2024-02-03 00:30:52 +01:00
Terry Jan Reedy 1183f1e6bf
gh-114913: Add newline to subprocess doc (#114941)
*creationflags* is a separate topic from *startupinfo*.
Start sentence with 'If given', like previous sentence.
2024-02-02 23:14:32 +00:00
Jokimax c4a2e8a2c5
gh-101599: argparse: simplify the option help string (GH-103372)
If the option with argument has short and long names,
output argument only once, after the long name:

   -o, --option ARG    description

instead of

   -o ARG, --option ARG    description
2024-02-02 22:13:00 +00:00
John Belmonte 73d20cafb5
Correct timedelta description (GH-101417)
It only represents the difference between two datetime or
date objects, not between two time objects.
2024-02-02 23:42:17 +02:00
Serhiy Storchaka b27812d632
Fix indentation of "versionchanged" in datetime.rst (GH-114933) 2024-02-02 23:09:16 +02:00
Alex Waygood 920b89f627
Bump ruff to 0.2.0 (#114932) 2024-02-02 21:04:15 +00:00
GILGAMESH 7e2703bbff
Update venv activate.bat to escape custom PROMPT variables on Windows (GH-114885) 2024-02-02 18:59:53 +00:00
Serhiy Storchaka c12240ed28
gh-114728: Fix documentation for comparison of objects in datetime module (GH-114749) 2024-02-02 20:53:24 +02:00
patenaud 9872855a31
GH-69695: Update ``PyImport_ImportModule`` description (GH-103836)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2024-02-02 17:31:55 +01:00
Steven Ward ee66c33349
gh-114909: Add --first-weekday option to usage message (#114910) 2024-02-02 17:13:00 +02:00
Andrew Rogers b3f0b698da
gh-104530: Enable native Win32 condition variables by default (GH-104531) 2024-02-02 13:50:51 +00:00