Pass the user/group name as Unicode to the formatting function,
instead of always decoding a bytes string from UTF-8..
(cherry picked from commit 28658485a5)
Co-authored-by: William Grzybowski <wg@FreeBSD.org>
This caused installation errors in some cases on Windows.
Patch by Julien Malard.
(cherry picked from commit 0afada163c)
Co-authored-by: Julien Malard <julien.malard@mail.mcgill.ca>
Some methods of the SMTP class use mutable default arguments. Specially
`send_message` is affected as it mutates one of the args by appending items
to it, which has side effects on further calls.
(cherry picked from commit d5fbe9b1a3)
Co-authored-by: Pablo Aguiar <scorphus@gmail.com>
When calling tp_descr_get(self, obj, type), make sure that
we own a strong reference to "self".
(cherry picked from commit 8f735485ac)
Co-authored-by: jdemeyer <jdemeyer@cage.ugent.be>
Update all test certs and keys to use future proof crypto settings:
* 3072 bit RSA keys
* SHA-256 signature
Signed-off-by: Christian Heimes <christian@python.org>
(cherry picked from commit e6dac00779)
Fix for invalid assert on big output of multiprocessing.Process.
(cherry picked from commit 266f4904a2)
Co-authored-by: Alexander Buchkovsky <olex.buchkovsky@gmail.com>
distutils.spawn.find_executable() now falls back on os.defpath if the
PATH environment variable is not set.
(cherry picked from commit 39487196c8)
Co-authored-by: Victor Stinner <vstinner@redhat.com>
* Fix Tools/clinic/clinic_test.py: add missing
FakeClinic.destination_buffers attribute and pass a file argument
to Clinic().
* Rename Tools/clinic/clinic_test.py to Lib/test/test_clinic.py:
add temporary Tools/clinic/ to sys.path to import the clinic
module.
Co-Authored-By: Pablo Galindo <pablogsal@gmail.com>
(cherry picked from commit 65fc98e7b1)
Co-authored-by: Victor Stinner <vstinner@redhat.com>
bpo-34544: If _Py_CoerceLegacyLocale() fails to coerce the C locale,
restore the LC_CTYPE locale to the its previous value.
(cherry picked from commit 8ea09110d4)
... by removing a superfluous "either".
Reported by Никита Люшненко on docs@.
(cherry picked from commit 98b976a2f8)
Co-authored-by: Zachary Ware <zachary.ware@gmail.com>
Sometimes some versions of the shared libraries that are part of the
traceback are compiled in optimised mode and the Program Counter (PC)
is not present, not allowing gdb to walk the frames back. When this
happens, the Python bindings of gdb raise an exception, making the
test impossible to succeed.
(cherry picked from commit f2ef51f8be)
Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
Added previously missing "--list" argument.
Made "--list" and "--list-paths" behavior consistent with the corresponding "-0" and "-0p" arguments.
(cherry picked from commit aada63b20e)
Co-authored-by: Brendan Gerrity <brerrity@gmail.com>
* bpo-34485: stdout uses surrogateescape on POSIX locale (GH-8986)
Standard streams like sys.stdout now use the "surrogateescape" error
handler, instead of "strict", on the POSIX locale (when the C locale is not
coerced and the UTF-8 Mode is disabled).
Add tests on sys.stdout.errors with LC_ALL=POSIX.
Fix the error handler of standard streams like sys.stdout:
PYTHONIOENCODING=":" is now ignored instead of setting the error handler to
"strict".
(cherry picked from commit 315877dc36)
* _Py_InitializeCore() now sets the LC_CTYPE locale to the user
preferred locale before checking if the C locale should be coerced
or not in _PyCoreConfig_Read().
* Fix pymain_read_conf(): remember if the C locale has been coerced
when the configuration should be read again if the encoding has
changed.
(cherry picked from commit 2c8ddcf4f1)
* The UTF-8 Mode is now also enabled by the "POSIX" locale, not only
by the "C" locale.
* On FreeBSD, Py_DecodeLocale() and Py_EncodeLocale() now also forces
the ASCII encoding if the LC_CTYPE locale is "POSIX", not only if
the LC_CTYPE locale is "C".
* test_utf8_mode.test_cmd_line() checks also that the command line
arguments are decoded from UTF-8 when the the UTF-8 Mode is enabled
with POSIX locale or C locale.
(cherry picked from commit 5cb258950c)
Remove "trace.cover" left from previous test runs before testing
that it is no longer created.
(cherry picked from commit b44a1d4f71)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
An old apparent AIX behavior workaround in test_subprocess's
test_undecodable_env is no longer needed.
(cherry picked from commit 89d79b1449)
Co-authored-by: Michael Felt <aixtools@users.noreply.github.com>
Avoids an integer underflow in the time module's year handling code.
(cherry picked from commit 76be0fffff)
Co-authored-by: Gregory P. Smith <greg@krypto.org>
Also, propagate the error from PyNumber_AsSsize_t() because we don't care
only about OverflowError which is not reported if the second argument is NULL.
Reported by Svace static analyzer.
(cherry picked from commit 7ecae3ca0b)
Co-authored-by: Alexey Izbyshev <izbyshev@ispras.ru>
The current C implementations **crash** if the input includes a surrogate
Unicode code point, which is not possible to encode in UTF-8.
Important notes:
1. It is possible to pass a non-UTF-8 string as a separator to the
`.isoformat()` methods.
2. The pure-Python `datetime.fromisoformat()` implementation accepts
strings with a surrogate as the separator.
In `datetime.fromisoformat()`, in the special case of non-UTF-8 separators,
this implementation will take a performance hit by making a copy of the
input string and replacing the separator with 'T'.
Co-authored-by: Alexey Izbyshev <izbyshev@ispras.ru>
Co-authored-by: Paul Ganssle <paul@ganssle.io>
(cherry picked from commit 096329f0b2)
Co-authored-by: Paul Ganssle <pganssle@users.noreply.github.com>