Commit Graph

112060 Commits

Author SHA1 Message Date
Evan d45cd2d207
Update documentation in datetime module strftime-and-strptime-behavior fix typo in '%W' format code description (GH-30232)
A small change to the documentation of datetime module , in the format codes section of stftime and strptime. Changed the description of format code '%W' from 'as a decimal number' to 'a zero padded   decimal number' so it's in line with the example having leading zeros.  Similar to the format code '%U' above.

Automerge-Triggered-By: GH:pganssle
2022-01-19 09:39:57 -08:00
Erlend Egeberg Aasland 71734d0b9c
Mark all clinic headers as generated (GH-30679) 2022-01-19 08:54:45 -08:00
Ken Jin 1faf7c4eff
bpo-45680: Minor formatting fix in stdtypes.rst (GH-30690)
Makes quotation consistent with rest of docs in commit 0eae9a2a2d.
2022-01-19 23:37:05 +08:00
Nikita Sobolev 0a49148e87
bpo-46413: properly test `__{r}or__` code paths in `_SpecialGenericAlias` (GH-30640)
Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
2022-01-19 23:32:25 +08:00
Alex Waygood 0eae9a2a2d
bpo-45680: Clarify documentation on ``GenericAlias`` objects (GH-29335)
The documentation on ``GenericAlias`` objects implies at multiple points that
only container classes can define ``__class_getitem__``. This is misleading.
This PR proposes a rewrite of the documentation to clarify that non-container
classes can define ``__class_getitem__``, and to clarify what it means when a
non-container class is parameterized.

See also: initial discussion of issues with this piece of documentation in
GH-29308, and previous BPO issue [42280](https://bugs.python.org/issue42280).

Also improved references in glossary and typing docs. Fixed some links.

Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
2022-01-19 22:53:41 +08:00
Nikita Sobolev 2792d6d18e
bpo-46416: Allow direct invocation of `Lib/test/test_typing.py` (GH-30641)
Use `__name__`
2022-01-19 22:13:38 +08:00
Irit Katriel 3bf6315c4c
bpo-22039: [doc] clarify that there are no plans to disable deleting an attribute via PyObject_SetAttr (GH-30639) 2022-01-19 12:03:51 +00:00
Victor Stinner a847785b40
bpo-43869: Time Epoch is the same on all platforms (GH-30664) 2022-01-19 11:27:11 +01:00
Ethan Furman 7c0914d35e
bpo-45535: [Enum] include special dunders in dir() (GH-30677)
Include the `__dunders__` in `dir()` that make `Enum` special:

- `__contains__`
- `__getitem__`
- `__iter__`
- `__len__`
- `__members__`
2022-01-18 15:13:13 -08:00
John Marshall 3852269b91
bpo-45554: Document multiprocessing.Process.exitcode values (GH-30142)
This addresses [bpo-45554]() by expanding the `exitcode` documentation to also describe what `exitcode` will be in cases of normal termination, `sys.exit()` called, and on uncaught exceptions.

Automerge-Triggered-By: GH:pitrou
2022-01-18 13:31:27 -08:00
Géry Ogam 16bf9bd157
bpo-44024: Improve the TypeError message in getattr and hasattr (GH-25863)
Use common error message for non-string attribute name in the builtin
functions getattr and hasattr.
The special check no longer needed since Python 3.0.
2022-01-18 22:46:26 +02:00
Thomas Klausner 60ceedbdd5
bpo-46045: Do not use POSIX semaphores on NetBSD (GH-30047)
This fixes hanging tests test_compileall,, test_multiprocessing_fork and test_concurrent_futures.
2022-01-18 22:38:35 +02:00
Kumar Aditya 65940fa5c1
bpo-20823: Clarify copyreg.pickle() documentation (GH-30230) 2022-01-18 21:53:43 +02:00
Nikita Sobolev 1292aa6db5
bpo-46425: Fix direct invocation of multiple test modules (GH-30666) 2022-01-18 21:28:18 +02:00
Miguel Brito ff7703c4b6
bpo-43869: Improve epoch docs (GH-25777) 2022-01-18 16:55:16 +01:00
Steve Dower 7407fe4c25
bpo-46028: Calculate base_executable by resolving symlinks in a venv (GH-30144) 2022-01-18 15:46:26 +00:00
Nikita Sobolev 32398294fb
bpo-46424: [typing] cover `Annotation[arg]` invalid usage in tests (GH-30663) 2022-01-18 22:43:51 +08:00
Erlend Egeberg Aasland bdf2ab1887
bpo-46402: Promote SQLite URI tricks in `sqlite3` docs (GH-30660)
Provide some examples of URI parameters in sqlite connect().

Co-authored-by: Ned Batchelder <ned@nedbatchelder.com>
2022-01-18 07:37:02 -05:00
Pablo Galindo Salgado 8c2fd09f36
bpo-46339: Include clarification on assert in 'get_error_line_from_tokenizer_buffers' (#30545) 2022-01-18 11:13:00 +00:00
Raymond Hettinger 243c31667c
bpo-42161: Hoist the _PyLong_GetOne() call out of the inner loop. (GH-30656) 2022-01-18 00:02:35 -08:00
Irit Katriel a287b31bcb
bpo-46411: Remove unnecessary calls to sys.exc_info() in tests (GH-30638) 2022-01-18 07:05:16 +00:00
bneuburg c47c9e6589
bpo-44934: Add optional feature AppendPath to Windows MSI installer (GH-27889)
The option must be enabled from the command line
2022-01-18 00:18:44 +00:00
Steve Dower 9e20ec4d43
Restore MSIX signing and ensure expired certificates are not selected (GH-30649)
Reverts the change in d6c6e6b and applies a better fix.
2022-01-17 20:22:52 +00:00
Nikita Sobolev 596cf51a4d
bpo-46418: [Enum] simplify `MODULE` declaration in tests (GH-30647) 2022-01-17 12:16:56 -08:00
Steve Dower d6c6e6ba73
Skip signing side-loadable MSIX for Windows (GH-30644)
We currently do not release these files, and so there's nothing lost by signing them.
Our code signing certificate is somehow incompatible with signing MSIX files. We may be able to re-enable this when we next renew, or if Microsoft updates their signing tool to work with our certificate.
2022-01-17 18:05:16 +00:00
zq1997 c118c2455c
bpo-46161: Fix bug in starunpack_helper in compile.c (GH-30235) 2022-01-17 17:45:44 +00:00
Ethan Furman 62a6594e66
bpo-40066: [Enum] fix tests (GH-30643)
- skip doctest that changes depending on target system
- skip doctest that only fails on CI
- substitute in values that change depending on target system
2022-01-17 08:52:42 -08:00
Kumar Aditya a4bc2218d2
bpo-46405: fix msvc compiler warnings (GH-30627) 2022-01-17 16:30:10 +00:00
Kumar Aditya 83d544b929
bpo-40066: [Enum] skip failing doc test (GH-30637) 2022-01-17 07:18:13 -08:00
Victor Stinner 16901c0482
bpo-44133: Skip PyThread_get_thread_native_id() if not available (GH-30636)
test_capi.test_export_symbols() doesn't check if Python exports the
"PyThread_get_thread_native_id" symbol if the _thread.get_native_id()
function is not available (if the PY_HAVE_THREAD_NATIVE_ID macro is
not defined).
2022-01-17 14:49:20 +01:00
Victor Stinner ad6e640f91
bpo-13886: Skip PTY non-ASCII tests if readline is loaded (GH-30631)
Skip test_builtin PTY tests on non-ASCII characters if the readline
module is loaded. The readline module changes input() behavior, but
test_builtin is not intented to test the readline module.

When the readline module is loaded, PyOS_Readline() uses the readline
implementation. In some cases, the Python readline callback
rlhandler() is called by readline with a string without non-ASCII
characters.
2022-01-17 14:00:50 +01:00
Victor Stinner 42a64c03ec
Revert "bpo-40066: [Enum] update str() and format() output (GH-30582)" (GH-30632)
This reverts commit acf7403f9b.
2022-01-17 13:58:40 +01:00
Christian Heimes 7f4b69b907
bpo-40280: Change subprocess imports for cleaner error on wasm32 (GH-30620) 2022-01-17 07:23:36 +01:00
Christian Heimes 91e33ac3d0
bpo-40280: Add requires_fork test helper (GH-30622) 2022-01-16 22:52:43 +01:00
Brandt Bucher 5cd9a162cd
bpo-46361: Fix "small" `int` caching (GH-30583) 2022-01-16 16:06:37 +00:00
Nikita Sobolev 09087b8519
bpo-46386: improve `test_typing:test_immutability_by_copy_and_pickle` (GH-30613) 2022-01-16 16:32:11 +09:00
Ethan Furman acf7403f9b
bpo-40066: [Enum] update str() and format() output (GH-30582)
Undo rejected PEP-663 changes:

- restore `repr()` to its 3.10 status
- restore `str()` to its 3.10 status

New changes:

- `IntEnum` and `IntFlag` now leave `__str__` as the original `int.__str__` so that str() and format() return the same result
- zero-valued flags without a name have a slightly changed repr(), e.g. `repr(Color(0)) == '<Color: 0>'`
- update `dir()` for mixed-in types to return all the methods and attributes of the mixed-in type
- added `_numeric_repr_` to `Flag` to control display of unnamed values
- enums without doc strings have a more comprehensive doc string added
- `ReprEnum` added -- inheriting from this makes it so only `__repr__` is replaced, not `__str__` nor `__format__`; `IntEnum`, `IntFlag`, and `StrEnum` all inherit from `ReprEnum`
2022-01-15 22:41:43 -08:00
Nikita Sobolev 37eab55ac9
bpo-46387: test all pickle protos in `test_field_descriptor` in `test_collections` (GH-30614) 2022-01-15 22:33:28 -06:00
Russel Webber 0a28118324
bpo-46388: Test NotImplemented code path for functools.total_ordering (GH-30616) 2022-01-15 14:15:32 -08:00
Mark Dickinson d02c5e9b55
bpo-46258: Streamline isqrt fast path (#30333) 2022-01-15 09:58:04 +00:00
Christian Heimes cfbde65df3
bpo-46383: Fix signature of zoneinfo module_free function (GH-30607) 2022-01-15 09:52:19 +01:00
Hugo van Kemenade 305588c67c
bpo-20281, bpo-29964: update datetime docs to refer %z and %Z to a pre-existing footnote (GH-30354) 2022-01-14 14:49:12 -08:00
Nikita Sobolev e674e48ddc
bpo-46242: [Enum] better error message for extending `Enum` with members (GH-30357) 2022-01-14 14:18:00 -08:00
Pablo Galindo 2402f1e1f8
Merge remote-tracking branch 'upstream/main' 2022-01-14 21:20:56 +00:00
Pablo Galindo 01d4fe0976
Post 3.11.0a4 2022-01-14 21:20:41 +00:00
Nikita Sobolev c5640ef875
bpo-46380: Apply tests to both C and Python version (GH-30606) 2022-01-14 13:13:45 -08:00
Mark Dickinson 025cbe7a9b
bpo-45569: Change PYLONG_BITS_IN_DIGIT default to 30 (GH-30497) 2022-01-14 18:54:56 +00:00
Christian Heimes ee1a8b336d
bpo-40280: Block more syscalls that are causing crashes in tests (GH-30601) 2022-01-14 18:48:44 +01:00
Hugo van Kemenade 73140de97c
bpo-23183: Document the timeit output (GH-30359)
Co-authored-by: Robert Collins <robertc@robertcollins.net>
2022-01-14 17:25:36 +00:00
neonene 71c0b859ae
bpo-46362: Ensure abspath() tests pass through environment variables to subprocess (GH-30595) 2022-01-14 15:31:15 +00:00