gh-115539: Allow enum.Flag to have None members (GH-115636)
(cherry picked from commit c2cb31bbe1)
Co-authored-by: Jason Zhang <yurenzhang2017@gmail.com>
gh-115154: Fix untokenize handling of unicode named literals (GH-115171)
(cherry picked from commit ecf16ee50e)
Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
Docs: Add explanation about little/big endian (GH-109841)
(cherry picked from commit 177b9cb52e)
Co-authored-by: Simon A. Eugster <simon.eu@gmail.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
* [3.12] gh-115572: Move `codeobject.replace()` docs to the data model (GH-115631)
(cherry picked from commit 0c80da4c14)
Co-authored-by: Daler <48939169+daler-sz@users.noreply.github.com>
* Remove note about copy.replace
---------
Co-authored-by: Daler <48939169+daler-sz@users.noreply.github.com>
It expects priority to be capped with 19, which is the cap for Linux,
but for FreeBSD the cap is 20 and the test fails under the similar
conditions. Tweak the condition to cover FreeBSD as well.
(cherry picked from commit 437924465d)
Co-authored-by: Dmitry Marakasov <amdmi3@amdmi3.ru>
Update documentation for re library to explain that a backreference `\g<0>` is
expanded to the entire string when using Match.expand().
Note that numeric backreferences to group 0 (`\0`) are not supported.
(cherry picked from commit d2d7808853)
Co-authored-by: Stevoisiak <S.Vascellaro@gmail.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Update _get_hostport to always remove square brackets
from IPv6 addresses. Then add them if needed
in "CONNECT .." and "Host: ".
(cherry picked from commit 465db27cb9)
Co-authored-by: Derek Higgins <derekh@redhat.com>
ListSeparator should not be encoded. This could happen when a long line
pushes its separator to the next line, which would have been encoded.
(cherry picked from commit 09fab93c3d)
Co-authored-by: Thomas Weißschuh <thomas@t-8ch.de>
lseek() always returns 0 for character pseudo-devices like
`/dev/urandom` (for other non-regular files, e.g. `/dev/stdin`, it
always returns -1, to which CPython reacts by raising appropriate
exceptions). They are thus technically seekable despite not having seek
semantics.
When calling read() on e.g. an instance of `io.BufferedReader` that
wraps such a file, `BufferedReader` reads ahead, filling its buffer,
creating a discrepancy between the number of bytes read and the internal
`tell()` always returning 0, which previously resulted in e.g.
`BufferedReader.tell()` or `BufferedReader.seek()` being able to return
positions < 0 even though these are supposed to be always >= 0.
Invariably keep the return value non-negative by returning
max(former_return_value, 0) instead, and add some corresponding tests.
(cherry picked from commit 26800cf25a)
Co-authored-by: 6t8k <58048945+6t8k@users.noreply.github.com>
Since 2f3941d743 this function returns the
response string, rather than nothing.
(cherry picked from commit e88ebc1c40)
Co-authored-by: Matthew Hughes <34972397+matthewhughes934@users.noreply.github.com>
docs: Add glossary term references to shutil docs (GH-115559)
Add glossary term references to shutil docs
(cherry picked from commit 318f2190bc)
Co-authored-by: Brian Schubert <brianm.schubert@gmail.com>
gh-115392: Fix doctest reporting incorrect line numbers for decorated functions (GH-115440)
(cherry picked from commit bb791c7728)
Co-authored-by: Brian Schubert <brianm.schubert@gmail.com>
Don't repeatedly say that keys and values are coerced into bytes.
(cherry picked from commit 81e140d10b)
Co-authored-by: Erlend E. Aasland <erlend@python.org>
gh-115403: Remove extra colon after "Examples" in datetime documentation (GH-115452)
(cherry picked from commit 6755c4e0c8)
Co-authored-by: Stanislav Lyu <wallseat@gmail.com>
ftplib docs: `timeout` doesn't have to be a whole number (GH-115443)
(cherry picked from commit 3fd2ad8241)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>